Skip to content

Commit 17b2db6

Browse files
authored
Merge pull request #909 from google/subst
ci: Run golangci-lint on pull requests and update version.
2 parents d4b8a71 + b2029d4 commit 17b2db6

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.github/workflows/golangci-lint.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,27 @@ on:
77
- main
88
pull_request:
99

10-
permissions:
11-
# golangci-lint does annotations, not comments
12-
# No-one knows what an annotation is, but I suspect it's printing file:line: msg to stdout.
13-
# https://github.community/t/what-are-annotations/16173/2
14-
checks: none
15-
1610
jobs:
1711
golangci:
1812
name: lint
1913
runs-on: ubuntu-latest
14+
permissions:
15+
# contents required to read the change
16+
contents: read
17+
# allow read access to any pull request
18+
pull-requests: read
19+
# golangci-lint does annotations, not comments, which needs `checks` to annotate the code.
20+
# These are hidden in the code, and not visible as comments in the PR.
21+
# https://github.com/golangci/golangci-lint-action/issues/5
22+
# No-one knows what an annotation is, but I suspect it's printing file:line: msg to stdout.
23+
# https://github.community/t/what-are-annotations/16173/2
24+
checks: write
2025
steps:
2126
- uses: actions/checkout@v4
2227
- uses: golangci/golangci-lint-action@v6
2328
with:
2429
# Required: the version of golangci-lint is required and must be
2530
# specified without patch version: we always use the latest patch
2631
# version.
27-
version: v1.57
32+
version: v1.59
33+
only-new-issues: ${{ github.event_name == 'pull_request' }}

.golangci.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ linters:
3737
- depguard
3838
- errcheck # handled by gosec, lots of false posi
3939
- exhaustive # this false-positives for switches with a default
40-
- exhaustivestruct # too noisy, labelling fields is not my jam
4140
- exhaustruct # above, renamed
4241
- forbidigo # exclude non prod tools
4342
- forcetypeassert # too many at the moment
@@ -48,13 +47,9 @@ linters:
4847
- gocognit # boo cyclomatic complexity
4948
- gocyclo # boo cyclomatic complexity
5049
- godox # TODOs are fine
51-
- golint # deprecated
5250
- gomnd # magic numbers in test tables are fine actually
5351
- gosec # run independently
54-
- ifshort # buggy, false positives
55-
- interfacer # deprecated
5652
- lll # go says long lines are ok, and this is trivially automatable
57-
- maligned # deprecated
5853
- musttag # don't agree with the premise
5954
- nakedret # weird thing to report on
6055
- nestif # cognitive complexity

0 commit comments

Comments
 (0)