Skip to content
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

Easily disabling some of the rules? #54

Closed
inadarei opened this issue Mar 8, 2015 · 10 comments
Closed

Easily disabling some of the rules? #54

inadarei opened this issue Mar 8, 2015 · 10 comments

Comments

@inadarei
Copy link

inadarei commented Mar 8, 2015

First: thanks for this project!

Now the question:

Is there any less surgical way to disable a rule other than removing it from /usr/local/lib/python2.7/dist-packages/ansiblelint/rules?

For instance, I really don't care for the trailing whitespace rule, to be honest, so it would be great if people could create a configuration file like you can with jslint or jshint.

Thanks!

@willthames
Copy link
Contributor

Thanks!

At the moment there are a couple of options:

  • use -x to skip rules with tags. But that might still not be specific enough.
  • Copy all the rules to another directory and delete the ones you don't want, and then specify the path with -r.

A configuration file would be a good idea - I don't really have time to implement such a feature at the moment but a working pull request would definitely be favourably considered

@charleswhchan
Copy link
Contributor

I would like this feature as well. Due to some outstanding issues/bugs in the Ansible 1.9 release, it's not always possible to achieve full compliance. As you mention:

  • -x is too broad, eg. both ANSIBLE0006 and ANSIBLE0007 belongs to the 'resources' tag.
  • -r requires additional maintainence to keep them in sync & updated.

I agree having a configuration file would be excellent, even something like .pylintrc. As I understand this is too much work. Would it be easier to add another command line option to allow exclusion based on ANSIBLExxxx? Or, alternatively overload the -x option to support exclusion for tags or rules?

@willthames
Copy link
Contributor

@charleswhchan that's a good idea. I still don't have much time available to look at it, but would support a pull request implementing such a change :)

Otherwise, I'll leave this open and see if I get bored at some point!

@charleswhchan
Copy link
Contributor

@willthames Created PR #73. Please review. ☺️

willthames added a commit that referenced this issue Sep 20, 2015
@willthames
Copy link
Contributor

Thanks @charleswhchan for #73.

We might still want a configuration file so I'll leave this open for now.

@charleswhchan
Copy link
Contributor

No problem. ☺️

@willthames
Copy link
Contributor

Closing this now - if we do want a configuration file, let's have that as a separate issue, preferably as a PR ;)

@aairey
Copy link

aairey commented Mar 28, 2018

As with every linter, this feels like a basic requirement ...

@willthames
Copy link
Contributor

@aairey and has a basic solution, using -x as per #73

Either that or use ansible-review which is much more configurable as to what rules are used.

@aairey
Copy link

aairey commented Mar 29, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants