version: "2" run: timeout: 1m formatters: enable: - gofmt - goimports linters: default: all disable: - depguard # We don't have any packages we need to block - exhaustruct # Too pedantic and impractical. Explicitly setting all struct values goes against Go's zero-value philosophy - forbidigo # Not suitable for CLI apps where printing to stdout is fine - gochecknoglobals # It's too strict and doesn't distinguish between "bad" globals (mutable shared state) and "good" globals (immutable configuration) - godox # TODO: enable it and handle all the remaning TODOs - mnd # Impractical. We deal with numbers like file permissions here, it's much clearer to see them explicitly. - noinlineerr # Impractical. Inline error handling is a common and idiomatic practice - testpackage # Impractical for CLI apps. This linter is more valuable for libraries to ensure a clean public API. - unparam # Impractical, it flags functions that are designed to be general-purpose, but happen to only be used with specific values currently - wsl # We use wsl_v5 instead - wrapcheck # Adds too much bloat, many of the errors are contextual enough and don't need wrapping settings: goconst: ignore-string-values: - "get" - "list" lll: line-length: 180 exclusions: # Typical presets to exclude: https://golangci-lint.run/docs/linters/false-positives/#exclusion-presets presets: - comments - common-false-positives - legacy - std-error-handling rules: - path: _test.go linters: - dupl # We don't mind duplicated code in tests. It helps with clarity - varnamelen # We don't mind short var names in tests. - revive # Complains too much about unused-params, but they help with tests readibility - funlen # We don't mind long functions in tests - path: test/ linters: - dupl - varnamelen