refactor: adopt portigo infrastructure patterns
Add config package with build-tag-switched dev/prod environments, structured logging via zerolog, Taskfile for dev workflow, golangci-lint config, testutil package, and improved DB setup with proper SQLite pragmas and cleanup. Rename sqlc output package from gen to repository. Switch to allowlist .gitignore, Alpine+UPX+scratch Dockerfile, and CI pipeline with test/lint gates before deploy.
This commit is contained in:
45
.golangci.yml
Normal file
45
.golangci.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
version: "2"
|
||||
|
||||
linters:
|
||||
default: standard
|
||||
enable:
|
||||
- errcheck
|
||||
- govet
|
||||
- staticcheck
|
||||
- gosec
|
||||
- bodyclose
|
||||
- sqlclosecheck
|
||||
- misspell
|
||||
- errname
|
||||
- copyloopvar
|
||||
|
||||
settings:
|
||||
staticcheck:
|
||||
checks:
|
||||
- all
|
||||
- "-ST1001" # dot imports
|
||||
- "-ST1003" # naming conventions
|
||||
gosec:
|
||||
excludes:
|
||||
- G104 # unhandled errors — redundant with errcheck
|
||||
- G107 # HTTP requests with variable URLs — expected in a web app
|
||||
- G115 # integer overflow conversion
|
||||
- G301 # directory permissions 0750 — 0755 is standard for data dirs
|
||||
- G404 # weak random — acceptable for game IDs and player IDs
|
||||
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
- goimports
|
||||
|
||||
settings:
|
||||
goimports:
|
||||
local-prefixes:
|
||||
- github.com/ryanhamamura/c4
|
||||
|
||||
issues:
|
||||
exclude-rules:
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- gosec
|
||||
- errcheck
|
||||
Reference in New Issue
Block a user