diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ac0ffb3..4f4d421 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -4,13 +4,13 @@ jobs: lint: runs-on: ubuntu-latest steps: + - name: Checkout source + uses: actions/checkout@v4 + - name: Install Go uses: actions/setup-go@v5 with: go-version: 1.21.x - - name: Checkout source - uses: actions/checkout@v4 - - - name: golangci-lint - uses: golangci/golangci-lint-action@v4 + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b34a2a4..b251317 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,6 +2,11 @@ # See https://pre-commit.com/hooks.html for more hooks repos: - repo: https://github.com/golangci/golangci-lint - rev: v1.41.1 + rev: v1.59.1 hooks: - id: golangci-lint +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.6.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec5be78..435f429 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,7 @@ PASS This project enforces linting with `golangci-lint`. You can use [pre-commit](https://pre-commit.com/) to check this automatically on commit, which will save time as you can catch linting errors before the CI does. ```console -$ pre-commit install +$ pre-commit install pre-commit installed at .git/hooks/pre-commit $ pre-commit run --all-files