Skip to content

Commit

Permalink
ci: configure linters
Browse files Browse the repository at this point in the history
This commit adds a config file ``.golangci.yaml`` for the lint workflow.
It removes the previous arguments passed to golangci-lint in favor of
the new configuration file.
  • Loading branch information
rebornplusplus committed Sep 25, 2023
1 parent 00c975a commit 609960b
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,3 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
version: v1.54.1
args: --disable-all --enable errcheck,staticcheck,unused
55 changes: 55 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
linters:
# Disable all linters.
# Default: false
disable-all: true
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default
enable:
- errcheck
- staticcheck
- unused

issues:
exclude-rules:
# exclusions for errcheck
- path: "^.*/log.go$"
text: "globalLogger.Output.*not checked"
linters:
- errcheck
- path: "^.*_test.go$"
text: "release.Render.*not checked"
linters:
- errcheck
- path: "^.*_test.go$"
text: "release.Walk.*not checked"
linters:
- errcheck
- path: "internal/setup/fetch.go"
text: "lockFile.Unlock.*not checked"
linters:
- errcheck
# exclusions for unused
# addDebugCommand is an useful function that may be used later
- path: "cmd/chisel/main.go"
text: "addDebugCommand.*unused"
linters:
- unused
# exclude common (unused) issues from log.go files
- path: "^.*/log.go$"
text: "logf.*unused"
linters:
- unused
- path: "^.*/log.go$"
text: "debugf.*unused"
linters:
- unused
- path: "^.*/log.go$"
text: "globalDebug.*unused"
linters:
- unused
- path: "^.*/log.go$"
text: "globalLogger.*unused"
linters:
- unused
max-issues-per-linter: 0
max-same-issues: 0

0 comments on commit 609960b

Please sign in to comment.