I've started using nogo and I'd like to give some feedback and suggest some minor improvements.
configuring analyzers section mentions that keys are regular expressions - would be useful to make it a link to the regex package where the syntax is described.
Examples of regex keys are misleading e.g. "src/js/*" and "src/(third_party|vendor)/*" are valid regexes, sure, but they look like glob syntax. Should be "src/js/.*" and "src/(third_party|vendor)/.*" probably. But then there is no point in having .* at the end so perhaps something more realistic like "/zz_generated.go$" to skip all generated files would be better? I was confused by examples and had to check the implementation to ensure that it's actually regex and not glob.
Feature request: I was trying to exclude only the "vendor" directory like that: ^vendor/ but it does not work. Presumably because the check is performed against the absolute file path - /vendor/ works fine. But /vendor/ will exclude all directories named like that, not just the one in the root of the project. This might lead to whole subtrees of packages not linted and to overlooked issues. Another case: what if I exclude /tmp/? Nothing at all will be linted because Bazel's output base is /private/var/tmp/ that matches, right? I'm suggesting to check the relative path, not the absolute.
One more suggestion: add configuration for all analyzers. For example, I want to disable all linters in (external|third_party)/* and have to copy-paste it for each linter.
I've started using nogo and I'd like to give some feedback and suggest some minor improvements.
"src/js/*"
and"src/(third_party|vendor)/*"
are valid regexes, sure, but they look like glob syntax. Should be"src/js/.*"
and"src/(third_party|vendor)/.*"
probably. But then there is no point in having.*
at the end so perhaps something more realistic like"/zz_generated.go$"
to skip all generated files would be better? I was confused by examples and had to check the implementation to ensure that it's actually regex and not glob.^vendor/
but it does not work. Presumably because the check is performed against the absolute file path -/vendor/
works fine. But/vendor/
will exclude all directories named like that, not just the one in the root of the project. This might lead to whole subtrees of packages not linted and to overlooked issues. Another case: what if I exclude/tmp/
? Nothing at all will be linted because Bazel's output base is/private/var/tmp/
that matches, right? I'm suggesting to check the relative path, not the absolute.Thank you!