You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Django at least, libraries can come with their own block-level tags. curlylint expects content in these tags to be indented to the same level as the tags themselves. I think we can agree that this behaviour is weird.
The better question is what else to expect. I could see both "enforce no indentation levels for unknown block tags" (because they may be whitespace-sensitive) and "enforce an additional indentation level" (as with tags such as {% block %}.
If you run curlylint --rule "indent: 4" test.html:
test.html
0:0 Bad text indentation, expected 0, got 4 indent
Oh no! 💥 💔 💥
1 error reported
Despite the reported line number, this refers to the indentation in someblock – if you remove someblock, the error goes away, if you remove blocktrans, the error remains unchanged.
Side note, because I keep opening issues: This is a great project and I am extremely happy to have found it. Thank you for providing and maintaining it!
The text was updated successfully, but these errors were encountered:
Hey @rixx, I’m happy you’re finding this useful and taking the time to write such detailed reports 😄 . In this case, I think this might be the same issue as #6? To me an additional level would be better as the default, and I think I’d consider the lack of that level to be a bug.
For the "whitespace-sensitive" tags – do you have other examples than Django’s blocktrans / blocktranslate? I’m interested in making a linting rule that mandates using the trimmed attribute for these, because it’s a fairly common annoyance to have to translate insignificant whitespace in .po files. I’m happy to be told this isn’t that simple though, if there are cases where whitespace is valuable.
Ah, yes, this seems to be a duplicate of #6, sorry for missing this!
I'm all for having a linting rule mandating trimmed because occasionally I forget and then I'm very annoyed with myself. I don't know of other block level tags that respect whitespace, and while there might be some, you could always handle that as it comes up, I guess?
Describe the bug
In Django at least, libraries can come with their own block-level tags. curlylint expects content in these tags to be indented to the same level as the tags themselves. I think we can agree that this behaviour is weird.
The better question is what else to expect. I could see both "enforce no indentation levels for unknown block tags" (because they may be whitespace-sensitive) and "enforce an additional indentation level" (as with tags such as
{% block %}
.Reproducible demo
test.html
:If you run
curlylint --rule "indent: 4" test.html
:Despite the reported line number, this refers to the indentation in
someblock
– if you removesomeblock
, the error goes away, if you removeblocktrans
, the error remains unchanged.Side note, because I keep opening issues: This is a great project and I am extremely happy to have found it. Thank you for providing and maintaining it!
The text was updated successfully, but these errors were encountered: