Skip to content

Commit

Permalink
Update .golangci.yml to disable some warning from revive linter
Browse files Browse the repository at this point in the history
Signed-off-by: Naoya Horiguchi <naoya.horiguchi@nec.com>
  • Loading branch information
nhoriguchi committed Nov 6, 2023
1 parent 65dfd15 commit 9f53e53
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,23 @@ linters:
- gosec
- gofmt
- misspell
linters-settings:
exclude-rules:
# Don't warn on unused parameters.
# Parameter names are useful; replacing them with '_' is undesirable.
- linters: [revive]
text: 'unused-parameter: parameter \S+ seems to be unused, consider removing or renaming it as _'

# staticcheck already has smarter checks for empty blocks.
# revive's empty-block linter has false positives.
# For example, as of writing this, the following is not allowed.
# for foo() { }
- linters: [revive]
text: 'empty-block: this block is empty, you can remove it'

# We *frequently* use the term 'new' in the context of properties
# (new and old properties),
# and we rarely use the 'new' built-in function.
# It's fine to ignore these cases.
- linters: [revive]
text: 'redefines-builtin-id: redefinition of the built-in function new'

0 comments on commit 9f53e53

Please sign in to comment.