flake: add golang-lint lsp (#2507)

Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
Kristoffer Dalby 2025-04-18 11:15:02 +02:00 committed by GitHub
parent 3287aa8bba
commit c30e3a4762
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 75 additions and 66 deletions

View File

@ -1,74 +1,79 @@
--- ---
run: version: "2"
timeout: 10m
build-tags:
- ts2019
issues:
skip-dirs:
- gen
linters: linters:
enable-all: true default: all
disable: disable:
- revive - cyclop
- lll - depguard
- gofmt - dupl
- exhaustruct
- funlen
- gochecknoglobals - gochecknoglobals
- gochecknoinits - gochecknoinits
- gocognit - gocognit
- funlen
- tagliatelle
- godox - godox
- ireturn
- execinquery
- exhaustruct
- nolintlint
- musttag # causes issues with imported libs
- depguard
- exportloopref
- tenv
# We should strive to enable these:
- wrapcheck
- dupl
- makezero
- maintidx
# Limits the methods of an interface to 10. We have more in integration tests
- interfacebloat - interfacebloat
- ireturn
# We might want to enable this, but it might be a lot of work - lll
- cyclop - maintidx
- makezero
- musttag
- nestif - nestif
- wsl # might be incompatible with gofumpt - nolintlint
- testpackage
- paralleltest - paralleltest
- revive
- tagliatelle
- testpackage
- wrapcheck
- wsl
settings:
gocritic:
disabled-checks:
- appendAssign
- ifElseChain
nlreturn:
block-size: 4
varnamelen:
ignore-names:
- err
- db
- id
- ip
- ok
- c
- tt
- tx
- rx
- sb
- wg
- pr
- p
- p2
ignore-type-assert-ok: true
ignore-map-index-ok: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
paths:
- third_party$
- builtin$
- examples$
- gen
linters-settings: formatters:
varnamelen: enable:
ignore-type-assert-ok: true - gci
ignore-map-index-ok: true - gofmt
ignore-names: - gofumpt
- err - goimports
- db exclusions:
- id generated: lax
- ip paths:
- ok - third_party$
- c - builtin$
- tt - examples$
- tx - gen
- rx
- sb
- wg
- pr
- p
- p2
gocritic:
disabled-checks:
- appendAssign
# TODO(kradalby): Remove this
- ifElseChain
nlreturn:
block-size: 4

6
flake.lock generated
View File

@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1743076231, "lastModified": 1744536153,
"narHash": "sha256-yQugdVfi316qUfqzN8JMaA2vixl+45GxNm4oUfXlbgw=", "narHash": "sha256-awS2zRgF4uTwrOKwwiJcByDzDOdo3Q1rPZbiHQg/N38=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6c5963357f3c1c840201eda129a99d455074db04", "rev": "18dd725c29603f582cf1900e0d25f9f1063dbf11",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -81,6 +81,9 @@
# golangci-lint = prev.golangci-lint.override { # golangci-lint = prev.golangci-lint.override {
# buildGoModule = buildGo; # buildGoModule = buildGo;
# }; # };
# golangci-lint-langserver = prev.golangci-lint.override {
# buildGoModule = buildGo;
# };
goreleaser = prev.goreleaser.override { goreleaser = prev.goreleaser.override {
buildGoModule = buildGo; buildGoModule = buildGo;
@ -114,6 +117,7 @@
buildDeps buildDeps
++ [ ++ [
golangci-lint golangci-lint
golangci-lint-langserver
golines golines
nodePackages.prettier nodePackages.prettier
goreleaser goreleaser