-
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
disable-line rule:comments-indentation does not seem to work? #343
Comments
Hello, Your snippet shows that the problem is on line 1 (not 2): the first comment ( If you use this, it shouldn't complain: # yamllint disable-line rule:comments-indentation
# Todo: Set this value Using I recommend using |
@adrienverge yes that is exactly my point. Why the Meanwhile you suggested
I am not sure if it is me but having disable rule on one depth and enable rule on another depth looks strange to me....hmm? |
It's not shocking to me, as However if you have a better (and consistent) behavior to propose, feel free! If you do so, please take into account that users may want foo: 1
bar: the following line is wrongly indented and I want it to be reported:
# yamllint disable-line rule: key-duplicates
bar: key-duplicates |
@adrianverge I see your point, but doesn't same concern apply for
Furthermore, this also does not work when it is on the same line with comment (probably due to double comment?). Even though there is an example about line-length using disable-line., in manual: https://yamllint.readthedocs.io/en/stable/disable_with_comments.html
I do not know what would be the best way to deal with this. I am pretty new to About I may be wrong, I did not use |
Hello @yurtesen,
Sounds fair. That's not how it was intended to work, but your modification proposal seems to solve your problem without creating new ones. Contributions are welcome! (they must be clean and come with tests)
I'm not sure about this. We may want to expect it to be aligned with content. It may not be necessarily aligned with |
I am throwing out some ideas but I think right now I don't have time to implement anything at this point. I already proceeded to some other tasks and I am already behind on several other tasks :( but if I have problems with yamllint again I can try to divert some time to help out with some improvements.
Comments are tricky. In documentation, there is an example:
Yet this gives warning
But this one is OK
But this give warning
All I am saying is that the way this works is quite confusing and unpredictable. Also probably unfixable due to complex combinations which can be created. Look at this, it passes fine...
although very difficult ot read IMHO. I think things would have been clearer if Something like this is much more readable, although not as flexible :
Like I said, I am just throwing out some ideas. The comments are tricky... |
FWIW line-length doesn't seem to be disable-able, for whatever reason, still, and this is the only reference I can find (maybe) to that bug.
|
Using
yamllint
1.25.0. I have a line like below:I am getting
warning comment not indented like content (comments-indentation)
on the# yamllint ...
line!If I use
Then everything is fine, no errors are reported.
Not sure what my be causing this? Shouldn't both work the same?
The text was updated successfully, but these errors were encountered: