-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glob/regex file excludes at rule level #850
Comments
|
Hi @comdiv thanks for filling the issue. |
Sorry but disagree with you. There are cases (in our real project) where it's highly required, so i add it to our fork. And i think we are not so special.
So where are many cases where different parts of project require different level and set of lint policy. What is special in our case - we use zero-tolerance for lint/coverage problems with auto control of no-regress with it. So same with linter. So if we see 100% of coverage and 0% warning of linter we knew exactly - that we have covered and refactor all stuff except that we explicitly express in config file of project (and we can reference our excludes). The main goal is to provide flexible lint policy for large project in one place (revive.toml) without breaking much. Per-rule excludes do it well and covers many profile problems. For now you provide
But for (3) one - add centralized rule-based file filter - it somehow conflicts with revive ideology? For me it's not too logical... ))) |
Where are different policies for some files.
For example we never treat
add-constant
as warning in*_test.go
files.For now - we cannot express excludes at rule level - just at global level.
Suggested to add
exclude : []string
for configuration andexclude: []*regexp.Regex
inside.To distinguish between regexes and strings we could use
~
prefix for regexes:The text was updated successfully, but these errors were encountered: