Compare commits

...

2 Commits

Author SHA1 Message Date
Spencer Brower
4b6e7072da feat(go): Added depguard rules. 2026-05-26 17:06:21 -04:00
Spencer Brower
0caabaf5a2 feat(go): Added more linters. 2026-05-26 16:36:46 -04:00
2 changed files with 46 additions and 2 deletions

1
templates/go/.air.toml Normal file
View File

@@ -0,0 +1 @@
tmp_dir = "var/air"

View File

@@ -1,12 +1,15 @@
version: "2" version: "2"
linters: linters:
default: standard default: standard
# default: all
enable: enable:
- bidichk - bidichk
- containedctx - containedctx
- contextcheck - contextcheck
- decorder - decorder
- err13 - depguard
- err113
- errchkjson
- errorlint - errorlint
- exhaustive - exhaustive
- fatcontext - fatcontext
@@ -16,14 +19,53 @@ linters:
- intrange - intrange
- maintidx - maintidx
- modernize - modernize
- nilnil - nlreturn
- noctx - noctx
- prealloc - prealloc
- recvcheck - recvcheck
- sloglint - sloglint
- unparam - unparam
- unused
- usestdlibvars - usestdlibvars
- whitespace
disable:
# Deprecateed
- gomodguard
- wsl
# Comment checker
- revive
- wrapcheck # reinclude
# Not useful
- cyclop
- funlen
- gocognit
- gocyclo
- nestif
- noinlineerr
- tagalign
- tagliatelle
- varnamelen
- wsl_v5
settings: settings:
depguard:
rules:
main:
list-mode: strict
files:
"**/main.go"
allow:
- "$gostd"
catchall:
list-mode: strict
files:
- "!$test"
- "!**/main.go"
- "**/internal/**"
allow:
- "$gostd"
- "golang.org/**"
recvcheck: recvcheck:
disable-builtin: false disable-builtin: false
exclusions: exclusions:
@@ -31,3 +73,4 @@ linters:
formatters: formatters:
enable: enable:
- goimports - goimports
- golines