Skip to content

Unified golangci config + closer minimal refactoring - #14

Merged
a-menshchikov merged 2 commits into
mainfrom
feature/unified-golangci-config
Nov 16, 2026
Merged

a-menshchikov merged 2 commits into
mainfrom
feature/unified-golangci-config

Conversation

@a-menshchikov

Copy link
Copy Markdown
Member

No description provided.

Every module had its own .golangci.yml, and the twelve files had drifted
apart: the linter sets, the iface analyzers, the gocognit threshold, and the
goheader template path all varied from module to module.

Keep one config in the repository root and let golangci-lint find it: the
config lookup walks up the directory tree, so running the linter from a
module directory still picks it up.

The goheader template path now uses the ${config-path} placeholder, which
expands to the config file directory, so the template is found regardless of
the working directory.

The differences between the modules are kept as explicit exclusions in the
common config. The gocognit threshold is excluded in place, with nolint
directives on the two affected functions, the way the other modules already
do it.

sloglint is dropped: it checks the style of the log/slog calls, which is
useful for the users of a logger, but not for the authors of a wrapper.
Collecting the errors over a closed channel needs an extra goroutine and an
unbuffered channel, which makes the collection noticeably slower than the
buffered one.

Keep the buffered channel and count the expected results explicitly: the
number of the close functions is known, so the loop does not have to rely on
the capacity of the error slice, which the intrange linter reports once the
module moves to Go 1.22.
@a-menshchikov
a-menshchikov merged commit 95366bf into main Nov 16, 2026
25 checks passed
@a-menshchikov
a-menshchikov deleted the feature/unified-golangci-config branch November 16, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant