Repository navigation
Unified golangci config + closer minimal refactoring - #14
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.