Skip to content

Commit

Permalink
upgrade golangci-lint, run pre-commit in CI, add more pre-commit hooks (
Browse files Browse the repository at this point in the history
#67)

* upgrade golangci-lint, run pre-commit in CI, add more pre-commit hooks

Signed-off-by: James Lamb <[email protected]>

* remove setup-python

Signed-off-by: James Lamb <[email protected]>

---------

Signed-off-by: James Lamb <[email protected]>
  • Loading branch information
jameslamb authored Aug 1, 2024
1 parent d2fa403 commit 2e70e2b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
7 changes: 6 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2e70e2b

Please sign in to comment.