Skip to content

Commit 6c591e4

Browse files
committed
Updated pre-commit hooks to use golangci-lint
1 parent e4c3ccb commit 6c591e4

3 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎.github/workflows/go.yml‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
name: Go
88

9-
on: [push, pull_request]
9+
"on": [push, pull_request]
1010

1111
defaults:
1212
run:
@@ -22,18 +22,11 @@ jobs:
2222
- name: Set up Go
2323
uses: actions/setup-go@v4
2424
with:
25-
go-version: '1.23.0'
25+
go-version: stable
2626

2727
- name: Build
2828
run: go build -v
2929
- name: Test
3030
run: |
3131
set -e
32-
go install github.com/go-critic/go-critic/cmd/gocritic@latest
33-
# go install golang.org/x/tools/cmd/goimports@latest
34-
go install golang.org/x/lint/golint@latest
35-
go install github.com/gordonklaus/ineffassign@latest
36-
pip install pre-commit
37-
pre-commit install
38-
pre-commit run --all-files
3932
go test -v

‎.pre-commit-config.yaml‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
---
22
repos:
3-
- repo: https://github.com/jessp01/pre-commit-golang.git
4-
rev: v0.5.4
5-
hooks:
6-
- id: go-fmt
3+
# - repo: https://github.com/jessp01/pre-commit-golang.git
4+
# rev: v0.5.9
5+
# hooks:
6+
# - id: go-fmt
77
# - id: go-imports
8-
- id: go-vet
9-
- id: go-lint
10-
- id: go-critic
11-
- id: go-ineffassign
8+
# - id: go-vet
9+
# - id: go-lint
10+
# - id: go-critic
11+
# - id: go-ineffassign
1212
# - repo: https://github.com/crate-ci/typos
1313
# rev: v1.32.0
1414
# hooks:
1515
# - id: typos
1616
# exclude_types: [yaml]
1717
# exclude: go.*
18+
- repo: https://github.com/golangci/golangci-lint.git
19+
rev: v2.13.2
20+
hooks:
21+
- id: golangci-lint-full
22+
name: golangci-lint-full
23+
description: Fast linters runner for Go. Runs on all files in the module
24+
entry: golangci-lint run --fix
25+
types: [go]
26+
language: golang
27+
require_serial: true
28+
pass_filenames: false

‎README.md‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,7 @@ pre-commit install
214214
215215
Following that, these tests will run every time you invoke `git commit`:
216216
```sh
217-
go fmt...................................................................Passed
218-
go imports...............................................................Passed
219-
go vet...................................................................Passed
220-
go lint..................................................................Passed
221-
go-critic................................................................Passed
217+
golangci-lint-full.......................................................Passed
222218
```
223219
224220
- Submit a pull request and include a succinct description of the feature or issue it addresses

0 commit comments

Comments
 (0)