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

Is it possible to dis/enable checks using comments? #8

Closed
tykeal opened this issue May 16, 2016 · 3 comments
Closed

Is it possible to dis/enable checks using comments? #8

tykeal opened this issue May 16, 2016 · 3 comments

Comments

@tykeal
Copy link

tykeal commented May 16, 2016

I work with a lot of yaml files that can have extremely long lines that can't be broken but aren't passing the default profile. I want to fail on any line that is > 80 char unless explicitly ignored. Is this possible?

For instance with puppet syntax checking I would do something like:

# lint:ignore:80chars
my very long line which is longer than 80 chars
# lint:endignore

I don't see anything in the docs to indicate if something like this is possible

@adrienverge
Copy link
Owner

Hi @tykeal, disabling checks using comments is a great idea. This is a feature I wanted to implement but unfortunately, I don't have time for this anymore.

Contributions are welcome!

@adrienverge
Copy link
Owner

adrienverge commented Jun 27, 2016

Hi @tykeal,

I implemented the feature to dis/enable checks using comments. You can use it like this:

# yamllint disable-line rule:line-length
my very long line which is longer than 80 chars

or like this:

# yamllint disable-line
my very long line which is longer than 80 chars

or like this:

my very long line which is longer than 80 chars  # yamllint disable-line

or like this:

# yamllint disable rule:line-length
my very long line which is longer than 80 chars
# yamllint enable

Could you try it and tell me if it works as you expect it?

git clone https://github.com/adrienverge/yamllint.git
cd yamllint
python setup.py sdist
pip install --upgrade --user dist/yamllint-1.2.2.tar.gz

Thanks!

PS: More documentation here

@tykeal
Copy link
Author

tykeal commented Jun 27, 2016

@adrienverge that looks exactly like what I was hoping for! Thanks!

I'll give it a try sometime today provided I can find the time :)

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

2 participants