-
Notifications
You must be signed in to change notification settings - Fork 302
Add .golangci.yml to standardize Go linting #5854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| version: "2" | ||
|
|
||
| run: | ||
| timeout: 5m | ||
| tests: true | ||
|
|
||
| linters: | ||
| disable-all: true | ||
| enable: | ||
| - errcheck # checks for unchecked errors | ||
| - govet # standard go vet checks | ||
| - ineffassign # detects ineffectual assignments | ||
| - staticcheck # advanced static analysis | ||
| - unused # checks for unused constants, variables, functions, and types | ||
|
|
||
| - revive # highly configurable, extensible linter (successor to golint) | ||
| - goconst # finds repeated strings that could be constants | ||
| - gocritic # checks for bugs, performance and style issues | ||
| - gocyclo # checks cyclomatic complexity of functions | ||
|
|
||
| linters-settings: | ||
| gocyclo: | ||
| min-complexity: 13 # Aligned with the project's pre-commit go-cyclo threshold | ||
|
|
||
|
Check failure on line 24 in .golangci.yml
|
||
| revive: | ||
| rules: | ||
| - name: exported | ||
| disabled: true # Can be enabled later to enforce public API documentation | ||
| - name: blank-imports | ||
| - name: context-as-argument | ||
| - name: context-keys-type | ||
| - name: dot-imports | ||
| - name: error-return | ||
| - name: error-strings | ||
| - name: error-naming | ||
| - name: if-return | ||
| - name: increment-decrement | ||
| - name: var-naming | ||
|
Check failure on line 38 in .golangci.yml
|
||
| - name: var-declaration | ||
| - name: package-comments | ||
| disabled: true | ||
|
Check failure on line 41 in .golangci.yml
|
||
|
|
||
| gocritic: | ||
| enabled-tags: | ||
| - diagnostic | ||
| - style | ||
| - performance | ||
| disabled-checks: | ||
| - ifElseChain | ||
| - singleCaseSwitch | ||
|
|
||
| issues: | ||
| exclude-rules: | ||
| # Relax linting rules slightly for test files to reduce noise | ||
| - path: _test\.go | ||
| linters: | ||
| - errcheck | ||
| - goconst | ||
| - gocritic | ||
|
Check failure on line 59 in .golangci.yml
|
||
Uh oh!
There was an error while loading. Please reload this page.