Skip to content

Commit d49c3ed

Browse files
authored
Enable more linters (#217)
1 parent d8a91de commit d49c3ed

File tree

4 files changed

+98
-104
lines changed

4 files changed

+98
-104
lines changed

.golangci.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,15 @@ linters-settings:
2828
- name: unused-parameter
2929
- name: var-declaration
3030
- name: var-naming
31+
govet:
32+
check-shadowing: true
33+
enable-all: true
3134

3235
linters:
33-
enable:
36+
enable:
3437
- asciicheck
38+
- bidichk
39+
- dupword
3540
- errcheck
3641
- errorlint
3742
- gofmt
@@ -45,15 +50,21 @@ linters:
4550
- misspell
4651
- nilerr
4752
- noctx
53+
- perfsprint
4854
- predeclared
55+
- reassign
4956
- revive
5057
- staticcheck
58+
- tagalign
59+
- tparallel
5160
- typecheck
5261
- unconvert
5362
- unparam
5463
- unused
64+
- usestdlibvars
5565
- wastedassign
56-
disable-all: true
66+
- whitespace
67+
disable-all: true
5768
issues:
5869
max-issues-per-linter: 0
5970
max-same-issues: 0

.pre-commit-config.yaml

Lines changed: 29 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,37 @@
11
# See https://pre-commit.com for more information
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
4-
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.5.0
6-
hooks:
7-
- id: trailing-whitespace
8-
- id: end-of-file-fixer
9-
- id: check-yaml
10-
args: [--allow-multiple-documents]
11-
- id: check-added-large-files
12-
- id: check-merge-conflict
13-
- id: check-shebang-scripts-are-executable
14-
- id: check-case-conflict
15-
- id: check-vcs-permalinks
16-
- id: mixed-line-ending
17-
args: [--fix=lf]
18-
- id: no-commit-to-branch
19-
- id: fix-byte-order-marker
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v4.5.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: end-of-file-fixer
9+
- id: check-yaml
10+
args: [--allow-multiple-documents]
11+
- id: check-added-large-files
12+
- id: check-merge-conflict
13+
- id: check-shebang-scripts-are-executable
14+
- id: check-case-conflict
15+
- id: check-vcs-permalinks
16+
- id: mixed-line-ending
17+
args: [--fix=lf]
18+
- id: no-commit-to-branch
19+
- id: fix-byte-order-marker
2020

21-
- repo: local
22-
hooks:
23-
- id: golang-diff
24-
name: create-go-diff
25-
entry: bash -c 'git diff -p origin/main > /tmp/diff.patch'
26-
language: system
27-
types: [go]
28-
pass_filenames: false
21+
- repo: https://github.com/golangci/golangci-lint
22+
rev: v1.55.2
23+
hooks:
24+
- id: golangci-lint-full
2925

30-
- repo: https://github.com/golangci/golangci-lint
31-
rev: v1.55.2
32-
hooks:
33-
- id: golangci-lint
34-
args: [--new-from-patch=/tmp/diff.patch]
26+
- repo: https://github.com/gitleaks/gitleaks
27+
rev: v8.18.2
28+
hooks:
29+
- id: gitleaks
3530

36-
- repo: https://github.com/gitleaks/gitleaks
37-
rev: v8.18.2
38-
hooks:
39-
- id: gitleaks
40-
41-
- repo: https://github.com/DavidAnson/markdownlint-cli2
42-
rev: v0.12.1
43-
hooks:
44-
- id: markdownlint-cli2
31+
- repo: https://github.com/DavidAnson/markdownlint-cli2
32+
rev: v0.12.1
33+
hooks:
34+
- id: markdownlint-cli2
4535

4636
ci:
47-
skip: [golang-diff, golangci-lint]
37+
skip: [golangci-lint-full]

0 commit comments

Comments
 (0)