Skip to content

Commit

Permalink
Add stylecheck linter to golangci-lint CI run
Browse files Browse the repository at this point in the history
This change adds the stylecheck linter to our golangci-lint ci run.
This catches a few nice things like double imports, checking if errors
end with punctuation/aren't capitalized. It also by default checks if
common initialisms (CPU, ID, HTTP, TLS) are in all caps, but this sets off a
metric ton of errors because of the amount of generated schema files we have.
We could exclude these directories from being linted altogether, but would like
to hear what others think. I don't see a way to exclude directories for only certain
checks (so if someone knows a way please do tell)

Signed-off-by: Daniel Canter <[email protected]>
  • Loading branch information
dcantah committed Aug 24, 2021
1 parent 12f00a3 commit 64f3019
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.38.0
version: v1.42.0 # Has fixes for stylecheck configuration https://github.com/golangci/golangci-lint/pull/2017/files
args: --timeout=5m

test:
Expand Down
8 changes: 8 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
linters:
enable:
- stylecheck

linters-settings:
stylecheck:
# https://staticcheck.io/docs/checks
checks: ["all", "-ST1003"]

0 comments on commit 64f3019

Please sign in to comment.