chore: add golangci-lint config

Amolith created

Assisted-by: Claude Opus 4.5 via Crush

Change summary

.golangci.yaml | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++
crush.json     |  87 ++++++++++++++++++++---------------
2 files changed, 176 insertions(+), 38 deletions(-)

Detailed changes

.golangci.yaml 🔗

@@ -0,0 +1,127 @@
+# SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
+#
+# SPDX-License-Identifier: CC0-1.0
+
+version: "2"
+linters:
+  default: none
+  # Be specific
+  enable:
+    - arangolint
+    - asasalint
+    - asciicheck
+    - bidichk
+    - bodyclose
+    - canonicalheader
+    - containedctx
+    - contextcheck
+    - copyloopvar
+    - cyclop
+    - decorder
+    - dogsled
+    - dupl
+    - dupword
+    - durationcheck
+    - embeddedstructfieldcheck
+    - err113
+    - errcheck
+    - errchkjson
+    - errname
+    - errorlint
+    - exhaustive
+    - exhaustruct
+    - exptostd
+    - fatcontext
+    - forbidigo
+    - forcetypeassert
+    - funcorder
+    - funlen
+    - ginkgolinter
+    - gocheckcompilerdirectives
+    - gochecknoglobals
+    - gochecknoinits
+    - gochecksumtype
+    - gocognit
+    - goconst
+    - gocritic
+    - gocyclo
+    - godoclint
+    - godot
+    - godox
+    - goheader
+    - gomoddirectives
+    - gomodguard
+    - goprintffuncname
+    - gosec
+    - gosmopolitan
+    - govet
+    - grouper
+    - iface
+    - importas
+    - inamedparam
+    - ineffassign
+    - interfacebloat
+    - intrange
+    - iotamixing
+    - ireturn
+    - lll
+    - loggercheck
+    - maintidx
+    - makezero
+    - mirror
+    - misspell
+    - mnd
+    - musttag
+    - nakedret
+    - nestif
+    - nilerr
+    - nilnesserr
+    - nilnil
+    - nlreturn
+    - noctx
+    - nolintlint
+    - nonamedreturns
+    - nosprintfhostport
+    - paralleltest
+    - perfsprint
+    - prealloc
+    - predeclared
+    - promlinter
+    - protogetter
+    - reassign
+    - recvcheck
+    - revive
+    - rowserrcheck
+    - sloglint
+    - spancheck
+    - sqlclosecheck
+    - staticcheck
+    - tagalign
+    - tagliatelle
+    - testableexamples
+    - testifylint
+    - testpackage
+    - thelper
+    - tparallel
+    - unconvert
+    - unparam
+    - unqueryvet
+    - unused
+    - usestdlibvars
+    - usetesting
+    - varnamelen
+    - wastedassign
+    - whitespace
+    - wrapcheck
+    - wsl_v5
+    - zerologlint
+
+  disable:
+    - depguard
+    - noinlineerr
+
+  settings:
+    tagliatelle:
+      case:
+        rules:
+          json: snake

crush.json 🔗

@@ -1,40 +1,51 @@
 {
-  "$schema": "https://charm.land/crush.json",
-  "lsp": {
-    "gopls": {
-      "options": {
-        "gofumpt": true,
-        "codelenses": {
-          "gc_details": true,
-          "generate": true,
-          "run_govulncheck": true,
-          "test": true,
-          "tidy": true,
-          "upgrade_dependency": true
-        },
-        "hints": {
-          "assignVariableTypes": true,
-          "compositeLiteralFields": true,
-          "compositeLiteralTypes": true,
-          "constantValues": true,
-          "functionTypeParameters": true,
-          "parameterNames": true,
-          "rangeVariableTypes": true
-        },
-        "analyses": {
-          "nilness": true,
-          "unusedparams": true,
-          "unusedvariable": true,
-          "unusedwrite": true,
-          "useany": true
-        },
-        "staticcheck": true,
-        "directoryFilters": [
-          "-.git",
-          "-node_modules"
-        ],
-        "semanticTokens": true
-      }
-    }
-  }
+	"$schema": "https://charm.land/crush.json",
+	"lsp": {
+		"gopls": {
+			"options": {
+				"gofumpt": true,
+				"codelenses": {
+					"gc_details": true,
+					"generate": true,
+					"run_govulncheck": true,
+					"test": true,
+					"tidy": true,
+					"upgrade_dependency": true
+				},
+				"hints": {
+					"assignVariableTypes": true,
+					"compositeLiteralFields": true,
+					"compositeLiteralTypes": true,
+					"constantValues": true,
+					"functionTypeParameters": true,
+					"parameterNames": true,
+					"rangeVariableTypes": true
+				},
+				"analyses": {
+					"nilness": true,
+					"unusedparams": true,
+					"unusedvariable": true,
+					"unusedwrite": true,
+					"useany": true
+				},
+				"staticcheck": true,
+				"directoryFilters": ["-.git", "-node_modules"],
+				"semanticTokens": true
+			}
+		},
+		"golangci-lint": {
+			"command": "golangci-lint-langserver",
+			"filetypes": ["go"],
+			"init_options": {
+				"command": [
+					"golangci-lint",
+					"run",
+					"--output.json.path",
+					"stdout",
+					"--show-stats=false",
+					"--issues-exit-code=1"
+				]
+			}
+		}
+	}
 }