-
Notifications
You must be signed in to change notification settings - Fork 101
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
ConsecutiveComments linter "good" example appears to have incorrect indenting #43
Comments
Hey @anselmbradford, sorry for the delay in response. You example works just fine for me—I don't get any syntax errors. You should be able to indent as many characters as you want, so the "good" example works as-is. Which version of |
Hey @anselmbradford, That file parses just fine for me, both with I'm not sure what other advice I can offer here--it seems like there's something about your system that is causing this issue. Can you get others to reproduce? What OS and Ruby version are you running? |
Hi @sds. What Ans is referring to is that in a HAML document, indentation must be consistent. The file he linked to already has consistent indentation, so it will parse fine. To reproduce the issue, you will need to add an extra space on line 2. The problem is that most people will probably use 2 spaces of indentation within a document, and if they follow your comment example that uses 3 spaces of indentation, the parsing will break because of inconsistent indentation. |
Thanks for the clarification @monfresh. My mistake—the documentation is clearly incorrect in this case. I've updated it to the following example: -#
This is a comment
spread over multiple lines that reads cleanly |
@sds FYI, I haven't double-checked, but I believe haml-lint may complain if there isn't a trailing space after |
The "good" example for the ConsecutiveComments linter has 3 spaces for all lines after the first. In practice this doesn't appear possible to do. Take the following partial snippet:
With 3 spaces present for the second line of the comment, the page fails with a
Haml::SyntaxError
error ofInconsistent indentation: 2 spaces used for indentation, but the rest of the document was indented using 3 spaces.
.A correctly functioning example instead uses 2 spaces for the lines after the first:
Is there a recommended format that left-aligns all pertinent comment lines, something like the following for example?
The text was updated successfully, but these errors were encountered: