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

New rule : indent-delta #227

Merged
merged 5 commits into from
Feb 11, 2018
Merged

Conversation

loicbourgois
Copy link
Contributor

Add a new optional rule to check indentation level between 2 consecutive lines.

<!-- indent-delta = false -->
<div>
\t\t<p>test</p> <!-- ok -->
</div>

<!-- indent-delta = true -->
<div>
\t<p>test</p> <!-- ok -->
</div>

<!-- indent-delta = true -->
<div>
\t\t<p>test</p> <!-- triggers an error -->
</div>

Could be improved if necessary with checking whether the indentation should increase or decrease based on whether HTML elements are closed or opened.

@coveralls
Copy link

coveralls commented Feb 1, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 0c282de on loicbourgois:indent-delta into f902b46 on htmllint:master.

@mlochbaum mlochbaum merged commit 0c282de into htmllint:master Feb 11, 2018
@mlochbaum
Copy link
Member

Looks good. I assume including package-lock.json was a mistake and have removed it. I also changed the handling of spaces followed by tabs (the tab should go up to the next multiple of width) and fixed the empty-line check so that it accounts for line endings with CR.

Using indent-width for the tab size as well as the indent width might not always be right, but I'll wait for someone to complain before adding a tab-width option.

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

Successfully merging this pull request may close these issues.

3 participants