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
Fix false negatives with block-indentation
rule
#2318
Fix false negatives with block-indentation
rule
#2318
Conversation
I tested this on a large codebase and it detected a handful of correct new violations which is great. I see a few issues however. The first issue might be a problem with this current PR, while the 2nd and 3rd issues might be an issue with the previous autofixing PR? Should we fix any of them in this PR or separate PRs? 1Before: <title>Title</title>
<g>
</g> After autofix (shouldn't <title>Title</title>
<g>
</g> 2I'm also seeing an autofix crash here with this template: <div>
</div>
{{#if foo}}
{{#if bar}}
{{/if}}
{{/if}}
3I'm seeing another autofix crash with this: <h3></h3>
<div>
<div>
<div>
</div>
</div>
</div>
Side note: Can you also add some more context in the PR description? |
block-indentation
rule
I added all your example. Should be good now 🙏 |
@VincentMolinie thanks for the quick fixes. I just tested it again and found these issues: Issue 1Before: {{relativeDate}} <span class="my-apps-date-connected__absolute">({{absoluteDate}})</span> After autofix (incorrectly removed spacing, also still flags a violation): {{relativeDate}}<span class="my-apps-date-connected__absolute">({{absoluteDate}})</span> Issue 2Before: <title></title>
<path/><path/> Does not autofix this. |
I don't know what should be the expected template in both cases 😅 . Should it be: {{relativeDate}}
<span class="my-apps-date-connected__absolute">({{absoluteDate}})</span> and <title></title>
<path/>
<path/> |
I think it should actually be valid to have multiple closed tags on the same line? So both of these should be valid / no violations. |
Okey should be good now 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@VincentMolinie just tested it and it looks good, nice work!
Can you add a brief summary to the PR description about how this affects the rule behavior?
Done, let me know if that's enough |
Summary
A lot of issues were not detected by this rule.
The following examples are invalid but were considered as valid:
Basically, everything that is NOT on the first line and is a direct child of the template was considered as valid