--- # yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.v2.jsonschema.json # golangci-lint configuration for f2b project # https://golangci-lint.run/usage/configuration/ version: "2" run: timeout: 5m modules-download-mode: readonly concurrency: 1 # Serial execution for deterministic results go: "1.25" linters: enable: # Essential linters - revive # Code style checking - errcheck # Error checking - govet # Go vet - gosec # Security checking - ineffassign # Inefficient assignment checking - unused # Unused variable checking - lll # Line length checking - usetesting # Unit testing # Code quality linters - misspell # Spell checking - unconvert # Unconvert checking - gocyclo # Cyclomatic complexity checking - prealloc # Preallocation checking - bodyclose # Body close checking - rowserrcheck # Rows error checking - sqlclosecheck # SQL close checking - durationcheck # Duration checking - errorlint # Error linting - predeclared # Predeclared identifier checking - wastedassign # Wasted assignment checking - containedctx # Contained context checking - errname # Error name checking - nilnil # Nil nil checking - thelper # Helper function checking - usestdlibvars # Use standard library variables - whitespace # Whitespace checking - godox # TODO/FIXME/etc comments - gocognit # Cognitive complexity checking disable: # Disable overly strict linters for this project - varnamelen # Variable name length checking - tagliatelle # Struct tag format checking - makezero # Make zero checking - testpackage # Separate test package requirement - paralleltest # Parallel test requirement - forcetypeassert # Force type assertion - ireturn # Return interface checking - nlreturn # New line return checking - cyclop # Cyclomatic complexity (covered by gocyclo) - funlen # Function length checking - maintidx # Maintainability index - nestif # Nested if checking - wsl # Whitespace linter (too strict) - gocritic # Too many style opinions - nakedret # Naked returns - nolintlint # Nolint directive checking - noctx # Context checking settings: errcheck: check-type-assertions: false check-blank: false exclude-functions: - (*os.File).Close - (io.Closer).Close govet: enable-all: true disable: - fieldalignment # Can be too strict for simple structs - shadow # Variable shadowing can be acceptable gocyclo: min-complexity: 20 misspell: locale: US prealloc: simple: true range-loops: true for-loops: false errorlint: errorf: false # Allow %v instead of %w for some cases lll: line-length: 120 # Set maximum line length to 120 characters formatters: enable: - gofmt - goimports - golines settings: gofmt: simplify: true goimports: local-prefixes: - github.com/ivuorinen/f2b golines: max-len: 120 tab-len: 4 shorten-comments: true reformat-tags: true chain-split-dots: true issues: max-issues-per-linter: 0 max-same-issues: 0 new: false fix: true