-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.golangci.yml
More file actions
64 lines (58 loc) · 2.51 KB
/
Copy path.golangci.yml
File metadata and controls
64 lines (58 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# golangci-lint configuration for the dotfiles repo.
# Phase 1 of GitHub issue #46 (CI hygiene baseline) — keep this conservative;
# we intentionally enable only a small, high-signal set of linters and ratchet
# stricter rules in later phases.
#
# Pinned tool version (CI must match, see .github/workflows/docker-image.yml):
# golangci-lint v2.0.2 (latest stable line as of January 2026)
#
# This repo contains SIX separate Go modules: sdk/fleet, sdk/gff, sdk/gsl,
# sdk/gss, sdk/tmux-mgr, sdk/wol. golangci-lint v2 auto-discovers each module
# when invoked from its directory, so we keep this config free of repo-root
# path assumptions and rely on the Makefile's `lint-go` target to iterate
# per-module (that target lints ALL modules before failing — do not reintroduce
# an early `|| exit 1`, which silently masked five modules for months).
version: "2"
run:
timeout: 5m
# Allow the linter to download deps if a fresh checkout hasn't run `go mod
# download` yet (common in CI).
modules-download-mode: readonly
linters:
default: none
enable:
- errcheck # unchecked errors are real bugs
- govet # the canonical Go vet suite
- ineffassign # detect dead assignments
- staticcheck # broad correctness + simplification ruleset
- unused # unused variables / functions / types
settings:
errcheck:
# Writes to a cobra command's own writer (cmd.OutOrStdout() /
# ErrOrStderr()) cannot be meaningfully recovered from: the command is
# already producing its final output, and there is nowhere left to report
# a failed write to. The Go stdlib takes the same position — fmt.Print*
# returns an error essentially nobody checks. Excluding the family here,
# once, keeps the 105 such call sites free of `_, _ =` noise so the
# remaining errcheck findings are all genuine unchecked-error bugs
# (Close, Run, Setenv, MkdirAll, WriteFile, ...) that DO deserve review.
#
# This is a deliberate narrowing of errcheck, not a backlog suppression:
# every other unchecked error in the tree is still a hard finding.
exclude-functions:
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
exclusions:
# Standard auto-generated and vendored paths.
generated: lax
paths:
- opt/google-cloud-sdk
- .*/testdata/.*
- third_party
- vendor
issues:
# Don't suppress duplicate issues across files — surface everything so we
# can fix at the root.
max-issues-per-linter: 0
max-same-issues: 0