diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01787a7..2a3392d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,9 +38,6 @@ jobs: strategy: matrix: go: - - 1.21.x - - 1.22.x - - 1.23.x - 1.24.x - 1.25.x @@ -357,7 +354,7 @@ jobs: permissions: contents: read packages: write - needs: [test, docker-test, dependency-review] + needs: [test] if: | github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop' || diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..66a4eb6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,44 @@ +# 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: v6.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + - repo: https://github.com/golangci/golangci-lint + rev: v2.6.1 + hooks: + - id: golangci-lint + name: golangci-lint + description: Fast linters runner for Go. Note that only modified files are linted, so linters like 'unused' that need to scan all files won't work as expected. + entry: golangci-lint run --new-from-rev HEAD --fix + types: [go] + language: golang + require_serial: true + pass_filenames: false + # - id: golangci-lint-full + # name: golangci-lint-full + # description: Fast linters runner for Go. Runs on all files in the module. Use this hook if you use pre-commit in CI. + # entry: golangci-lint run --fix + # types: [go] + # language: golang + # require_serial: true + # pass_filenames: false + - id: golangci-lint-fmt + name: golangci-lint-fmt + description: Fast linters runner for Go. Formats all files in the repo. + entry: golangci-lint fmt + types: [go] + language: golang + require_serial: true + pass_filenames: false + - id: golangci-lint-config-verify + name: golangci-lint-config-verify + description: Verifies the configuration file + entry: golangci-lint config verify + files: '\.golangci\.(?:yml|yaml|toml|json)' + language: golang + pass_filenames: false