Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
go-version: 1.17

- name: Lint
uses: golangci/golangci-lint-action@v6.5.0
uses: golangci/golangci-lint-action@v7.0.0
with:
version: latest
args: --timeout 5m
Expand Down
153 changes: 79 additions & 74 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,94 +1,99 @@
linters-settings:
govet:
shadow: true
golint:
min-confidence: 0
gocyclo:
min-complexity: 15
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 3
misspell:
locale: US
lll:
line-length: 140
goimports:
local-prefixes: github.com/ernado/ige
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
disabled-checks:
- hugeParam
- rangeValCopy
- exitAfterDefer
- whyNoLint
- singleCaseSwitch

version: "2"
linters:
disable-all: true
default: none
enable:
- dogsled
- dupl
- errcheck
- gochecknoglobals
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- gochecknoglobals
- gocognit

# Do not enable:
# - wsl (too opinionated about newlines)
# - godox (todos are OK)
# - bodyclose (false positives on helper functions)
# - prealloc (not worth it in scope of this project)
# - maligned (same as prealloc)
# - funlen (gocyclo is enough)

issues:
exclude:
- "xor - result 0 \\(int\\) is never used"
exclude-rules:
# Disable linters that are annoying in tests.
- path: _test\.go
linters:
- gocyclo
- errcheck
- dupl
- gosec
- funlen
- goconst
- gocognit
- scopelint
- lll
- gochecknoglobals
# Ignore shadowing of err.
- linters: [govet]
text: 'declaration of "err"'
# Ignore linters in main packages.
- path: main\.go
linters: [gochecknoglobals, goconst, funlen, gocognit, gocyclo]
settings:
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 3
gocritic:
disabled-checks:
- hugeParam
- rangeValCopy
- exitAfterDefer
- whyNoLint
- singleCaseSwitch
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
gocyclo:
min-complexity: 15
lll:
line-length: 140
misspell:
locale: US
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- dupl
- errcheck
- funlen
- gochecknoglobals
- gocognit
- goconst
- gocyclo
- gosec
- lll
- scopelint
path: _test\.go
- linters:
- govet
text: declaration of "err"
- linters:
- funlen
- gochecknoglobals
- gocognit
- goconst
- gocyclo
path: main\.go
- path: (.+)\.go$
text: xor - result 0 \(int\) is never used
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gofmt
- goimports
settings:
goimports:
local-prefixes:
- github.com/ernado/ige
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
Loading