I'd like to exclude comments from the lll output. lll has the --exclude flag I could use for that (https://github.com/walle/lll), but it doesn't seem to be supported by golangcli-lint.
lll linter on our codebase and found that only comments are affected. Many of them are long for a good reason, ie. a long url that can't be broken up, etc. In any case, it would be useful to transparently allow the configuration of the underlying linters in the way they support it (i.e. not invent new config rules in golangci-lint and translate them to the underlying linter). Other people might be using lll with another custom exclude rule, for example.
2. Many of them are long for a good reason, ie. a long url that can't be broken up
Exactly the problem I have: it's impossible to make the comment line shorter.
I feel a tiny stab or irony that I have to make the comment _longer_ to ignore it with a nolint[:lll] command, e.g.
// nolint[:lll] See https://longurl.org/path/to/thing/with/commit/has/1232u4t98u98fdugdsgeawefe/now/a/file.txt
Same issue here, trying exclude: ^\/\/.+ but without result. Is this a syntax problem?
Currently there's example in readme for excluding certain patterns from linting.
From README:
# Exclude lll issues for long lines with go:generate
- linters:
- lll
source: "^//go:generate "
In case of long comments it would be:
- linters:
- lll
source: "^// "
Closing.
Thanks @matoous, that works perfectly!
This is my config, so you can see what to add directly to .golangci.yml:
issues:
exclude-rules:
- linters:
- lll
source: "^// "
Most helpful comment
Thanks @matoous, that works perfectly!
This is my config, so you can see what to add directly to
.golangci.yml: