version: "2" linters: default: none enable: - errcheck - govet - staticcheck - unused - ineffassign - gosec - bodyclose - noctx settings: errcheck: # Best-effort cleanup and response writes. A failure here has no # useful handler; the caller already logs or returns the main error. exclude-functions: - (io.Closer).Close - (*os.File).Close - (*database/sql.Rows).Close - (*database/sql.Tx).Rollback - (*mime/multipart.Form).RemoveAll - os.Remove - os.RemoveAll - (net/http.ResponseWriter).Write - (*encoding/json.Encoder).Encode - (github.com/yuin/goldmark/util.BufWriter).WriteString - (github.com/gliderlabs/ssh.Session).Exit - io.Copy - io.WriteString - fmt.Fprintf gosec: excludes: - G104 # errcheck covers unchecked errors - G115 # int conversions are byte packing and bounded lengths - G120 # bodies are already capped by http.MaxBytesReader in bodyLimit - G124 # Secure is set from BASE_URL; theme/sort cookies must not be HttpOnly - G202 # table names are compile-time constants, values are bound - G204 # running git with request args is the core of this program - G301 # world-readable data dir is intended - G304 # paths are built from validated repo names - G306 # avatars and artifacts are served publicly - G702 # taint analysis: same as G204 - G703 # taint analysis: same as G304 - G706 # log injection: log lines are for the operator - G710 # redirect targets are built from validated repo names exclusions: rules: - path: _test\.go linters: [gosec, errcheck, noctx, bodyclose] - path: internal/web/views/ text: "ST1001" # gomponents is written with a dot import - path: internal/ci/ linters: [bodyclose] # doJSON and putArchive close the body before returning - path: internal/web/(ci|git)\.go text: "G705" # SVG badge from a fixed enum; git pkt-line bytes are not HTML formatters: enable: - gofumpt settings: gofumpt: module-path: hearthforge extra: group-params: true