diff --git a/.github/labeler.yml b/.github/labeler.yml index 8da26f55..b299b3d9 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,26 +1,27 @@ change: - - head-branch: ['^change/'] + - head-branch: ["^change/"] enhancement: - - head-branch: ['^feature/', '^feat/', '^enhancement/', '^enh/'] + - head-branch: ["^feature/", "^feat/", "^enhancement/", "^enh/"] bug: - - head-branch: ['^fix/', '^bug/'] + - head-branch: ["^fix/", "^bug/"] chore: - - head-branch: ['^chore/'] + - head-branch: ["^chore/"] tests: - - head-branch: ['^tests/', '^test/'] + - head-branch: ["^tests/", "^test/"] - changed-files: - - any-glob-to-any-file: '**/*_test.go' + - any-glob-to-any-file: "**/*_test.go" documentation: - - head-branch: ['^docs/', '^doc/'] + - head-branch: ["^docs/", "^doc/"] - changed-files: - - any-glob-to-any-file: '**/*.md' + - any-glob-to-any-file: "**/*.md" dependencies: - - head-branch: ['^deps/', '^dep/', '^dependabot/', 'pre-commit-ci-update-config'] + - head-branch: + ["^deps/", "^dep/", "^dependabot/", "pre-commit-ci-update-config"] - changed-files: - - any-glob-to-any-file: ['go.mod', 'go.sum'] + - any-glob-to-any-file: ["go.mod", "go.sum"] diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ed4de046..c1320e27 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -60,3 +60,15 @@ jobs: config: .markdownlint-cli2.yaml globs: "**/*.md" fix: false + + yaml-lint: + name: YAML lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install yamllint + run: pip install yamllint + + - name: Lint YAML files + run: yamllint . diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index 4fb80ac7..a838ce00 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -1,6 +1,6 @@ name: OpenSSF Scorecards on: - branch_protection_rule: + branch_protection_rule: # yamllint disable-line rule:empty-values schedule: - cron: "29 22 * * 5" # run every Friday at 22:29 UTC push: diff --git a/.golangci.yml b/.golangci.yml index 26ccc9a7..815a5926 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -30,10 +30,10 @@ linters-settings: - name: var-naming errcheck: exclude-functions: - - (github.com/go-kit/log.Logger).Log + - (github.com/go-kit/log.Logger).Log linters: - enable: + enable: - asciicheck - errcheck - errorlint @@ -57,7 +57,7 @@ linters: - unparam - unused - wastedassign - disable-all: true + disable-all: true issues: max-issues-per-linter: 0 max-same-issues: 0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 560e9bfc..337446fd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,54 +1,58 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - args: [--allow-multiple-documents] - - id: check-ast - - id: check-added-large-files - - id: check-merge-conflict - - id: check-shebang-scripts-are-executable - - id: check-executables-have-shebangs - - id: check-symlinks - - id: check-case-conflict - - id: check-vcs-permalinks - - id: check-json - - id: pretty-format-json - args: [--autofix, --no-ensure-ascii] - - id: mixed-line-ending - args: [--fix=lf] - - id: no-commit-to-branch - - id: requirements-txt-fixer - - id: fix-byte-order-marker + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + args: [--allow-multiple-documents] + - id: check-ast + - id: check-added-large-files + - id: check-merge-conflict + - id: check-shebang-scripts-are-executable + - id: check-executables-have-shebangs + - id: check-symlinks + - id: check-case-conflict + - id: check-vcs-permalinks + - id: check-json + - id: pretty-format-json + args: [--autofix, --no-ensure-ascii] + - id: mixed-line-ending + args: [--fix=lf] + - id: no-commit-to-branch + - id: requirements-txt-fixer + - id: fix-byte-order-marker -- repo: local - hooks: - - id: golang-diff - name: create-go-diff - entry: bash -c 'git diff -p origin/main > /tmp/diff.patch' - language: system - types: [go] - pass_filenames: false + - repo: local + hooks: + - id: golang-diff + name: create-go-diff + entry: bash -c 'git diff -p origin/main > /tmp/diff.patch' + language: system + types: [go] + pass_filenames: false -- repo: https://github.com/golangci/golangci-lint - rev: v1.56.2 - hooks: - - id: golangci-lint - args: [--new-from-patch=/tmp/diff.patch] + - repo: https://github.com/golangci/golangci-lint + rev: v1.56.2 + hooks: + - id: golangci-lint + args: [--new-from-patch=/tmp/diff.patch] -- repo: https://github.com/gitleaks/gitleaks - rev: v8.18.2 - hooks: - - id: gitleaks + - repo: https://github.com/gitleaks/gitleaks + rev: v8.18.2 + hooks: + - id: gitleaks -- repo: https://github.com/DavidAnson/markdownlint-cli2 - rev: v0.12.1 - hooks: - - id: markdownlint-cli2 + - repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.12.1 + hooks: + - id: markdownlint-cli2 + - repo: https://github.com/adrienverge/yamllint.git + rev: v1.35.1 + hooks: + - id: yamllint ci: - skip: [golang-diff, golangci-lint] + skip: [golang-diff, golangci-lint, yamllint] diff --git a/.yamllint.yaml b/.yamllint.yaml new file mode 100644 index 00000000..7d0320c4 --- /dev/null +++ b/.yamllint.yaml @@ -0,0 +1,22 @@ +--- +yaml-files: + - "*.yaml" + - "*.yml" + +ignore-from-file: .gitignore + +extends: default + +rules: + comments: + min-spaces-from-content: 1 + comments-indentation: enable + document-start: disable + empty-values: enable + line-length: + max: 120 + ignore: | + .goreleaser.yml + .github/ + truthy: + check-keys: false