.golangci.yaml

  1# SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
  2#
  3# SPDX-License-Identifier: CC0-1.0
  4
  5version: "2"
  6linters:
  7  default: none
  8  # Be specific
  9  enable:
 10    - arangolint
 11    - asasalint
 12    - asciicheck
 13    - bidichk
 14    - bodyclose
 15    - canonicalheader
 16    - containedctx
 17    - contextcheck
 18    - copyloopvar
 19    - cyclop
 20    - decorder
 21    - dogsled
 22    - dupl
 23    - dupword
 24    - durationcheck
 25    - embeddedstructfieldcheck
 26    - err113
 27    - errcheck
 28    - errchkjson
 29    - errname
 30    - errorlint
 31    - exhaustive
 32    - exhaustruct
 33    - exptostd
 34    - fatcontext
 35    - forbidigo
 36    - forcetypeassert
 37    - funcorder
 38    - funlen
 39    - ginkgolinter
 40    - gocheckcompilerdirectives
 41    - gochecknoglobals
 42    - gochecknoinits
 43    - gochecksumtype
 44    - gocognit
 45    - goconst
 46    - gocritic
 47    - gocyclo
 48    - godoclint
 49    - godot
 50    - godox
 51    - goheader
 52    - gomoddirectives
 53    - gomodguard
 54    - goprintffuncname
 55    - gosec
 56    - gosmopolitan
 57    - govet
 58    - grouper
 59    - iface
 60    - importas
 61    - inamedparam
 62    - ineffassign
 63    - interfacebloat
 64    - intrange
 65    - iotamixing
 66    - ireturn
 67    - lll
 68    - loggercheck
 69    - maintidx
 70    - makezero
 71    - mirror
 72    - misspell
 73    - mnd
 74    - musttag
 75    - nakedret
 76    - nestif
 77    - nilerr
 78    - nilnesserr
 79    - nilnil
 80    - nlreturn
 81    - noctx
 82    - nolintlint
 83    - nonamedreturns
 84    - nosprintfhostport
 85    - paralleltest
 86    - perfsprint
 87    - prealloc
 88    - predeclared
 89    - promlinter
 90    - protogetter
 91    - reassign
 92    - recvcheck
 93    - revive
 94    - rowserrcheck
 95    - sloglint
 96    - spancheck
 97    - sqlclosecheck
 98    - staticcheck
 99    - tagalign
100    - tagliatelle
101    - testableexamples
102    - testifylint
103    - testpackage
104    - thelper
105    - tparallel
106    - unconvert
107    - unparam
108    - unqueryvet
109    - unused
110    - usestdlibvars
111    - usetesting
112    - varnamelen
113    - wastedassign
114    - whitespace
115    - wrapcheck
116    - wsl_v5
117    - zerologlint
118    - prealloc
119
120  disable:
121    - depguard
122
123  settings:
124    exhaustruct:
125      exclude:
126        # External types where zero values are intentional by library design
127        - github.com/modelcontextprotocol/go-sdk/mcp.Implementation
128        - github.com/modelcontextprotocol/go-sdk/mcp.Tool
129        - github.com/modelcontextprotocol/go-sdk/mcp.Resource
130        - github.com/modelcontextprotocol/go-sdk/mcp.ReadResourceResult
131        - github.com/modelcontextprotocol/go-sdk/mcp.ResourceContents
132        - github.com/modelcontextprotocol/go-sdk/mcp.CallToolResult
133        - github.com/modelcontextprotocol/go-sdk/mcp.TextContent
134        - git.secluded.site/go-lunatask.CreateTaskRequest
135        - git.secluded.site/go-lunatask.UpdateTaskRequest
136        # Internal output types where some fields are optional
137        - git.sr.ht/~amolith/lunatask-mcp-server/tools/tasks.CreateOutput
138        - git.sr.ht/~amolith/lunatask-mcp-server/tools/tasks.UpdateOutput
139        - git.sr.ht/~amolith/lunatask-mcp-server/tools/tasks.DeleteOutput
140        - git.sr.ht/~amolith/lunatask-mcp-server/tools/habits.TrackOutput
141        - git.sr.ht/~amolith/lunatask-mcp-server/tools/timestamp.Output
142    tagliatelle:
143      case:
144        rules:
145          json: snake
146    varnamelen:
147      ignore-names:
148        - c   # client
149        - f   # file handle
150        - id  # entity ID
151        - ok  # boolean check
152        - db  # database
153        - tx  # transaction
154        - fn  # function
155
156  exclusions:
157    rules:
158      - path: cmd/
159        linters:
160          - gochecknoglobals  # Cobra commands are package-level vars
161          - gochecknoinits    # Cobra uses init() for flag registration
162          - wrapcheck         # CLI returns errors for display, wrapping adds noise
163          - mnd               # Magic numbers in cobra.ExactArgs are clear in context
164          - dupl              # Builder types differ but share method signatures
165      - path: cmd/
166        text: unused-parameter  # Cobra callback signatures can't be changed
167      - path: tools/
168        linters:
169          - err113            # Handler validation errors are descriptive by nature
170          - cyclop            # Apply options funcs have many branches but simple logic
171          - wrapcheck         # Returning errors to MCP doesn't need wrapping
172      - path: internal/config/
173        text: "0o700"           # Config directory permissions are intentional