-
Notifications
You must be signed in to change notification settings - Fork 280
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
Exclude vendor/... by default #1056
Comments
hey @mcandre have you tried add: |
Yes, I see a configuration file and command line flag to do this. I'm asking for better default behavior. The vendor directory is a Go programming language standard. We should also ensure that the config file and flags are able to overwrite default exclusion patterns, as some users have a need to examine third party code with linters. But the majority of users will be drowned out by unactionable noise for warnings on code they don't directly control. |
@chavacava my #1058 adds vendor/... to ignored only if we don set -exclude from cli or exclude = [] in revive.toml what you think? |
@mfederowicz thanks for the PR. My concern with by default excluding vendor is that revive will not behave as before thus vendor will be silently excluded. About the PR: What if I actually want to analyze vendor? How I need to run revive? |
@chavacava good point, then you can run revive with one exclude even pointing to not existing path:
then excludePatterns list is processed as before (and vendor back to game) :) |
ofcourse @chavacava iam open to other options (maybe dedicated flag in config set by default to true) or something else :) |
@mfederowicz IMO the hack of excluding a non existent pattern rather than a solution is a smell on the inconvenience of excluding vendor by default. The same on adding a flag to actually (un)do what another already existing flag does. @mcandre I'll close this issue for now, if in the future there is more people interested in changes on the treatment of vendor we can re-open the discussion. |
This is the first Go linter in recent memory to not exclude the vendor directory properly by default. |
#1058 is merged. |
Amazing! When can we expect a new release to include this change? |
@mcandre if you dont want to wait for new release you can install dev version of revive by:
|
Is your feature request related to a problem? Please describe.
revive's default behavior with
revive ./...
generates linter warnings for third party code in thevendor
directory, when using thego mod vendor
system to manage dependencies.Linter warnings for third party code tends to be less actionable compared to linter warnings for first party code.
Describe the solution you'd like
Exclude
vendor/...
by default.Describe alternatives you've considered
Baking
-exclude vendor/...
into mcand/remage-extras's Revive task.The text was updated successfully, but these errors were encountered: