Skip to content

Commit 76069da

Browse files
committed
Add yamllint
1 parent d8a91de commit 76069da

File tree

6 files changed

+87
-53
lines changed

6 files changed

+87
-53
lines changed

.github/labeler.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
change:
2-
- head-branch: ['^change/']
2+
- head-branch: ["^change/"]
33

44
enhancement:
5-
- head-branch: ['^feature/', '^feat/', '^enhancement/', '^enh/']
5+
- head-branch: ["^feature/", "^feat/", "^enhancement/", "^enh/"]
66

77
bug:
8-
- head-branch: ['^fix/', '^bug/']
8+
- head-branch: ["^fix/", "^bug/"]
99

1010
chore:
11-
- head-branch: ['^chore/']
11+
- head-branch: ["^chore/"]
1212

1313
tests:
14-
- head-branch: ['^tests/', '^test/']
14+
- head-branch: ["^tests/", "^test/"]
1515
- changed-files:
16-
- any-glob-to-any-file: 'tests/**/*'
16+
- any-glob-to-any-file: "tests/**/*"
1717

1818
documentation:
19-
- head-branch: ['^docs/', '^doc/']
19+
- head-branch: ["^docs/", "^doc/"]
2020
- changed-files:
21-
- any-glob-to-any-file: '**/*.md'
21+
- any-glob-to-any-file: "**/*.md"
2222

2323
dependencies:
24-
- head-branch: ['^deps/', '^dep/', '^dependabot/', 'pre-commit-ci-update-config']
24+
- head-branch:
25+
["^deps/", "^dep/", "^dependabot/", "pre-commit-ci-update-config"]
2526
- changed-files:
26-
- any-glob-to-any-file: ['go.mod', 'go.sum']
27+
- any-glob-to-any-file: ["go.mod", "go.sum"]

.github/workflows/lint.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ on:
44
pull_request:
55
branches:
66
- main
7-
paths-ignore:
8-
- "**.md"
9-
- "LICENSE"
7+
8+
defaults:
9+
run:
10+
shell: bash
1011

1112
concurrency:
1213
group: ${{ github.ref_name }}-lint
@@ -54,3 +55,15 @@ jobs:
5455
config: .markdownlint-cli2.yaml
5556
globs: "**/*.md"
5657
fix: false
58+
59+
yaml-lint:
60+
name: YAML lint
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v3
64+
65+
- name: Install yamllint
66+
run: pip install yamllint
67+
68+
- name: Lint YAML files
69+
run: yamllint .

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: OpenSSF Scorecards
22
on:
3-
branch_protection_rule:
3+
branch_protection_rule: # yamllint disable-line rule:empty-values
44
schedule:
55
- cron: "42 15 * * 6" # run every Saturday at 15:42 UTC
66
push:

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ linters-settings:
3030
- name: var-naming
3131

3232
linters:
33-
enable:
33+
enable:
3434
- asciicheck
3535
- errcheck
3636
- errorlint
@@ -53,7 +53,7 @@ linters:
5353
- unparam
5454
- unused
5555
- wastedassign
56-
disable-all: true
56+
disable-all: true
5757
issues:
5858
max-issues-per-linter: 0
5959
max-same-issues: 0

.pre-commit-config.yaml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
4-
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.5.0
6-
hooks:
7-
- id: trailing-whitespace
8-
- id: end-of-file-fixer
9-
- id: check-yaml
10-
args: [--allow-multiple-documents]
11-
- id: check-added-large-files
12-
- id: check-merge-conflict
13-
- id: check-shebang-scripts-are-executable
14-
- id: check-case-conflict
15-
- id: check-vcs-permalinks
16-
- id: mixed-line-ending
17-
args: [--fix=lf]
18-
- id: no-commit-to-branch
19-
- id: fix-byte-order-marker
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
args: [--allow-multiple-documents]
11+
- id: check-added-large-files
12+
- id: check-merge-conflict
13+
- id: check-shebang-scripts-are-executable
14+
- id: check-case-conflict
15+
- id: check-vcs-permalinks
16+
- id: mixed-line-ending
17+
args: [--fix=lf]
18+
- id: no-commit-to-branch
19+
- id: fix-byte-order-marker
2020

21-
- repo: local
22-
hooks:
23-
- id: golang-diff
24-
name: create-go-diff
25-
entry: bash -c 'git diff -p origin/main > /tmp/diff.patch'
26-
language: system
27-
types: [go]
28-
pass_filenames: false
21+
- repo: local
22+
hooks:
23+
- id: golang-diff
24+
name: create-go-diff
25+
entry: bash -c 'git diff -p origin/main > /tmp/diff.patch'
26+
language: system
27+
types: [go]
28+
pass_filenames: false
2929

30-
- repo: https://github.com/golangci/golangci-lint
31-
rev: v1.55.2
32-
hooks:
33-
- id: golangci-lint
34-
args: [--new-from-patch=/tmp/diff.patch]
30+
- repo: https://github.com/golangci/golangci-lint
31+
rev: v1.55.2
32+
hooks:
33+
- id: golangci-lint
34+
args: [--new-from-patch=/tmp/diff.patch]
3535

36-
- repo: https://github.com/gitleaks/gitleaks
37-
rev: v8.18.2
38-
hooks:
39-
- id: gitleaks
36+
- repo: https://github.com/gitleaks/gitleaks
37+
rev: v8.18.2
38+
hooks:
39+
- id: gitleaks
4040

41-
- repo: https://github.com/DavidAnson/markdownlint-cli2
42-
rev: v0.12.1
43-
hooks:
44-
- id: markdownlint-cli2
41+
- repo: https://github.com/DavidAnson/markdownlint-cli2
42+
rev: v0.12.1
43+
hooks:
44+
- id: markdownlint-cli2
4545

4646
ci:
4747
skip: [golang-diff, golangci-lint]

.yamllint.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
yaml-files:
3+
- "*.yaml"
4+
- "*.yml"
5+
6+
extends: default
7+
8+
rules:
9+
comments:
10+
min-spaces-from-content: 1
11+
comments-indentation: enable
12+
document-start: disable
13+
empty-values: enable
14+
line-length:
15+
max: 120
16+
ignore: |
17+
.goreleaser.yml
18+
.github/
19+
truthy:
20+
check-keys: false

0 commit comments

Comments
 (0)