Last active
February 28, 2026 16:08
-
-
Save tho/8f75e77fb42b49aaf30cf8131b6d4b1e to your computer and use it in GitHub Desktop.
golangci-lint configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Golangci-lint configuration file | |
| # https://golangci-lint.run | |
| version: "2" | |
| linters: | |
| default: all | |
| disable: | |
| - exhaustruct | |
| - noinlineerr | |
| - tagalign | |
| - varnamelen | |
| - wsl | |
| - wsl_v5 | |
| settings: | |
| copyloopvar: | |
| check-alias: true | |
| decorder: | |
| disable-dec-order-check: false | |
| disable-dec-num-check: false | |
| depguard: | |
| rules: | |
| main: | |
| allow: | |
| - $gostd | |
| embeddedstructfieldcheck: | |
| empty-line: true | |
| forbid-mutex: true | |
| errcheck: | |
| check-type-assertions: true | |
| check-blank: true | |
| fatcontext: | |
| check-struct-pointers: true | |
| funcorder: | |
| alphabetical: true | |
| gocritic: | |
| enable-all: true | |
| godoclint: | |
| default: all | |
| options: | |
| max-len: | |
| length: 117 | |
| govet: | |
| enable-all: true | |
| disable: | |
| - fieldalignment | |
| iface: | |
| enable: | |
| - identical | |
| - unused | |
| - opaque | |
| - unexported | |
| nilnil: | |
| detect-opposite: true | |
| nlreturn: | |
| block-size: 3 | |
| nolintlint: | |
| require-explanation: true | |
| require-specific: true | |
| revive: | |
| enable-all-rules: true | |
| rules: | |
| - name: add-constant | |
| disabled: true | |
| - name: cognitive-complexity | |
| disabled: true | |
| - name: function-length | |
| disabled: true | |
| - name: line-length-limit | |
| disabled: true | |
| sloglint: | |
| no-global: "all" | |
| context: "scope" | |
| static-msg: true | |
| key-naming-case: snake | |
| staticcheck: | |
| checks: | |
| - all | |
| testifylint: | |
| enable-all: true | |
| unconvert: | |
| fast-math: true | |
| usestdlibvars: | |
| time-date-month: true | |
| time-month: true | |
| time-layout: true | |
| crypto-hash: true | |
| default-rpc-path: true | |
| sql-isolation-level: true | |
| tls-signature-scheme: true | |
| constant-kind: true | |
| usetesting: | |
| context-background: true | |
| context-todo: true | |
| os-temp-dir: true | |
| wrapcheck: | |
| extra-ignore-sigs: | |
| - (context.Context).Err( | |
| - (*os/exec.Cmd).Wait() | |
| exclusions: | |
| warn-unused: true | |
| rules: | |
| # https://github.com/Djarvur/go-err113/issues/10 | |
| - linters: | |
| - err113 | |
| text: "do not define dynamic errors" | |
| - path: _test\.go | |
| linters: | |
| - funlen | |
| formatters: | |
| enable: | |
| - gci | |
| - gofumpt | |
| settings: | |
| gci: | |
| sections: | |
| - standard | |
| - default | |
| - localmodule | |
| gofumpt: | |
| extra-rules: true | |
| run: | |
| modules-download-mode: readonly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .PHONY: lint | |
| lint: | |
| golangci-lint run | |
| .PHONY: lint-fix | |
| lint-fix: | |
| golangci-lint run --fix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment