Skip to content

Override linter selection with the command line #715

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

Closed
abustany opened this issue Sep 20, 2019 · 2 comments
Closed

Override linter selection with the command line #715

abustany opened this issue Sep 20, 2019 · 2 comments
Labels
area: config Related to .golangci.yml and/or cli options enhancement New feature or improvement stale No recent correspondence or work activity

Comments

@abustany
Copy link

abustany commented Sep 20, 2019

Version: 1.18.0 built from 31afdf8

It doesn't seem to be possible at the moment to disable specific linters for a given run: if a linter is enabled in the configuration file, disabling it using -D on the command line will result in an error. Would it make sense to consider that command line options have a higher precedence than the configuration file, instead of seeing this as a conflict?

The background for this issue is that we want to have different defaults for developers and for our CI pipeline, while sharing the bulk of the configuration. Having two config files would lead to lots of duplicated information...

@jirfag jirfag added the enhancement New feature or improvement label Sep 24, 2019
@tpounds tpounds added the area: config Related to .golangci.yml and/or cli options label Oct 6, 2019
@stale
Copy link

stale bot commented Apr 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No recent correspondence or work activity label Apr 3, 2020
@stale stale bot closed this as completed Apr 17, 2020
@roshan-rubrik
Copy link

Yes, This will be very handy option. Currently, We need to enable as well as disable linter explicitly. Some type of precedence would be great.

  1. Command line option should be higher precedence than configuration file.
  2. And Instead of throwing error, We can make Disable as higher precedence than Enable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: config Related to .golangci.yml and/or cli options enhancement New feature or improvement stale No recent correspondence or work activity
Projects
None yet
Development

No branches or pull requests

4 participants