⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [2/3] ⎯⎯⎯⎯
[error] Closing tag name \`\` should be lowercase. Use \`\` instead. (html-tag-name-lowercase) [Correctable]
test/fixtures/test-file-with-errors.html.erb:2:22
1 │
Running --fix would correct this to:
test/fixtures/test-file-with-errors.html.erb
1 │
- 2 │
Test content
+ │
Test content
3 │

Rule offenses:
html-tag-name-lowercase (2 offenses in 1 file)
html-img-require-alt (1 offense in 1 file)
Summary:
Checked 1 file
Failing 2 errors (2 offenses across 1 file)
Not failing 1 warning (1 offense across 1 file, below --fail-level=error)
Fixable 3 offenses | 2 autocorrectable using \`--fix\`
Rules 149 enabled | 22 not enabled"
`;
exports[`CLI Output Formatting > formats simple output correctly 1`] = `
"✓ Using Herb config file at /test/herb/javascript/packages/linter/.herb.yml
test/fixtures/test-file-simple.html.erb:
2:3 ✗ Opening tag name \`
\` should be lowercase. Use \`\` instead. (html-tag-name-lowercase) [Correctable]
2:22 ✗ Closing tag name \`\` should be lowercase. Use \`\` instead. (html-tag-name-lowercase) [Correctable]
Rule offenses:
html-tag-name-lowercase (2 offenses in 1 file)
Summary:
Checked 1 file
Offenses 2 errors (2 offenses across 1 file)
Fixable 2 offenses | 2 autocorrectable using \`--fix\`
Rules 149 enabled | 22 not enabled"
`;
exports[`CLI Output Formatting > formats simple output for bad-file correctly 1`] = `
"✓ Using Herb config file at /test/herb/javascript/packages/linter/.herb.yml
test/fixtures/bad-file.html.erb:
1:1 ✗ Opening tag name \`
\` should be lowercase. Use \`\` instead. (html-tag-name-lowercase) [Correctable]
1:16 ✗ Closing tag name \`\` should be lowercase. Use \`\` instead. (html-tag-name-lowercase) [Correctable]
Rule offenses:
html-tag-name-lowercase (2 offenses in 1 file)
Summary:
Checked 1 file
Offenses 2 errors (2 offenses across 1 file)
Fixable 2 offenses | 2 autocorrectable using \`--fix\`
Rules 149 enabled | 22 not enabled"
`;
exports[`CLI Output Formatting > formats success output correctly 1`] = `
"✓ Using Herb config file at /test/herb/javascript/packages/linter/.herb.yml
✓ test/fixtures/clean-file.html.erb - No issues found
Summary:
Checked 1 file
Offenses 0 offenses
Fixable 0 offenses
Rules 149 enabled | 22 not enabled"
`;
exports[`CLI Output Formatting > handles boolean attributes 1`] = `
"✓ Using Herb config file at /test/herb/javascript/packages/linter/.herb.yml
✓ test/fixtures/boolean-attribute.html.erb - No issues found
Summary:
Checked 1 file
Offenses 0 offenses
Fixable 0 offenses
Rules 149 enabled | 22 not enabled"
`;
exports[`CLI Output Formatting > handles multiple errors correctly 1`] = `
"✓ Using Herb config file at /test/herb/javascript/packages/linter/.herb.yml
[error] Opening tag name \`
\` should be lowercase. Use \`\` instead. (html-tag-name-lowercase) [Correctable]
test/fixtures/bad-file.html.erb:1:1
→ 1 │ Bad file
│ ~~~~
2 │
Running --fix would correct this to:
test/fixtures/bad-file.html.erb
- 1 │ Bad file
+ │ Bad file
2 │
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [1/2] ⎯⎯⎯⎯
[error] Closing tag name \`\` should be lowercase. Use \`\` instead. (html-tag-name-lowercase) [Correctable]
test/fixtures/bad-file.html.erb:1:16
→ 1 │
Bad file
│ ~~~~
2 │
Running --fix would correct this to:
test/fixtures/bad-file.html.erb
- 1 │
Bad file
+ │
Bad file
2 │
Rule offenses:
html-tag-name-lowercase (2 offenses in 1 file)
Summary:
Checked 1 file
Offenses 2 errors (2 offenses across 1 file)
Fixable 2 offenses | 2 autocorrectable using \`--fix\`
Rules 149 enabled | 22 not enabled"
`;
exports[`CLI Output Formatting > herb:disable rules 1`] = `
"✓ Using Herb config file at /test/herb/javascript/packages/linter/.herb.yml
[error] Use \`<%#\` instead of \`<% #\` for \`herb:disable\` directives. Herb directives only work with ERB comment syntax (\`<%# ... %>\`). (erb-comment-syntax) [Correctable]
test/fixtures/disabled-1.html.erb:12:19
10 │
hello
<%# herb:disable %>
11 │
→ 12 │
hello
<% # herb:disable %>
│ ~~~~~~~~~~~~~~~~~~~~
13 │
14 │
hello
<%# herb:disable html-tag-name-lowercase %>
Running --fix would correct this to:
test/fixtures/disabled-1.html.erb
11 │
- 12 │
hello
<% # herb:disable %>
+ │
hello
<%# herb:disable %>
13 │
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [1/8] ⎯⎯⎯⎯
[error] \`herb:disable\` comment is missing rule names. Specify \`all\` or list specific rules to disable. (herb-disable-comment-missing-rules)
test/fixtures/disabled-1.html.erb:10:19
8 │
hello
<%# herb:disable html-tag-name-lowercase,
│ html-tag-name-lowercase %>
9 │
→ 10 │
hello
<%# herb:disable %>
│ ~~~~~~~~~~~~~~~~~~~
11 │
12 │
hello
<% # herb:disable %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [2/8] ⎯⎯⎯⎯
[warning] Duplicate rule \`all\` in \`herb:disable\` comment. Remove the duplicate. (herb-disable-comment-no-duplicate-rules)
test/fixtures/disabled-1.html.erb:6:41
4 │
hello
<%# herb:disable html-tag-name-lowercase, all %>
5 │
→ 6 │
hello
<%# herb:disable all, all %>
│ ~~~
7 │
8 │
hello
<%# herb:disable html-tag-name-lowercase,
│ html-tag-name-lowercase %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [3/8] ⎯⎯⎯⎯
[warning] Duplicate rule \`html-tag-name-lowercase\` in \`herb:disable\` comment. Remove the duplicate. (herb-disable-comment-no-duplicate-rules)
test/fixtures/disabled-1.html.erb:8:61
6 │
hello
<%# herb:disable all, all %>
7 │
→ 8 │
hello
<%# herb:disable html-tag-name-lowercase,
│ html-tag-name-lowercase %>
│ ~~~~~~~~~~~~~~~~~~~~~~~
9 │
10 │
hello
<%# herb:disable %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [4/8] ⎯⎯⎯⎯
[warning] Using \`all\` with specific rules is redundant. Use \`herb:disable all\` by itself or list only specific rules. (herb-disable-comment-no-redundant-all)
test/fixtures/disabled-1.html.erb:2:36
1 │
→ 2 │
hello
<%# herb:disable all, html-tag-name-lowercase %>
│ ~~~
3 │
4 │
hello
<%# herb:disable html-tag-name-lowercase, all %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [5/8] ⎯⎯⎯⎯
[warning] Using \`all\` with specific rules is redundant. Use \`herb:disable all\` by itself or list only specific rules. (herb-disable-comment-no-redundant-all)
test/fixtures/disabled-1.html.erb:4:61
2 │
hello
<%# herb:disable all, html-tag-name-lowercase %>
3 │
→ 4 │
hello
<%# herb:disable html-tag-name-lowercase, all %>
│ ~~~
5 │
6 │
hello
<%# herb:disable all, all %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [6/8] ⎯⎯⎯⎯
[warning] Using \`all\` with specific rules is redundant. Use \`herb:disable all\` by itself or list only specific rules. (herb-disable-comment-no-redundant-all)
test/fixtures/disabled-1.html.erb:6:36
4 │
hello
<%# herb:disable html-tag-name-lowercase, all %>
5 │
→ 6 │
hello
<%# herb:disable all, all %>
│ ~~~
7 │
8 │
hello
<%# herb:disable html-tag-name-lowercase,
│ html-tag-name-lowercase %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [7/8] ⎯⎯⎯⎯
[warning] No offenses from \`html-tag-name-lowercase\` on this line. Remove the \`herb:disable\` comment. (herb-disable-comment-unnecessary)
test/fixtures/disabled-1.html.erb:14:19
12 │
hello
<% # herb:disable %>
13 │
→ 14 │
hello
<%# herb:disable html-tag-name-lowercase %>
│ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 │
16 │
Rule offenses:
herb-disable-comment-no-redundant-all (3 offenses in 1 file)
herb-disable-comment-no-duplicate-rules (2 offenses in 1 file)
erb-comment-syntax (1 offense in 1 file)
herb-disable-comment-missing-rules (1 offense in 1 file)
herb-disable-comment-unnecessary (1 offense in 1 file)
Summary:
Checked 1 file
Failing 2 errors (2 offenses across 1 file)
Not failing 6 warnings (6 offenses across 1 file, below --fail-level=error)
Ignored 8 offenses suppressed with herb:disable
Fixable 8 offenses | 1 autocorrectable using \`--fix\`
Rules 149 enabled | 22 not enabled"
`;
exports[`CLI Output Formatting > herb:disable rules 2`] = `
"✓ Using Herb config file at /test/herb/javascript/packages/linter/.herb.yml
[warning] Using \`all\` with specific rules is redundant. Use \`herb:disable all\` by itself or list only specific rules. (herb-disable-comment-no-redundant-all)
test/fixtures/disabled-2.html.erb:6:30
4 │
<%# herb:disable this-rule-doesnt-exist %>
5 │
→ 6 │
<%# herb:disable all, this-rule-doesnt-exist %>
│ ~~~
7 │
8 │
<%# herb:disable html-tag-name-lowercase,
│ this-rule-doesnt-exist %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [1/13] ⎯⎯⎯⎯
[warning] Unknown rule \`this-rule-doesnt-exist\`. Did you mean \`source-indentation\`? (herb-disable-comment-valid-rule-name)
test/fixtures/disabled-2.html.erb:4:30
2 │ <% %> <%# herb:disable erb-no-empty-tags, html-tag-name-lowercase %>
3 │
→ 4 │
<%# herb:disable this-rule-doesnt-exist %>
│ ~~~~~~~~~~~~~~~~~~~~~~
5 │
6 │
<%# herb:disable all, this-rule-doesnt-exist %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [2/13] ⎯⎯⎯⎯
[warning] Unknown rule \`this-rule-doesnt-exist\`. Did you mean \`source-indentation\`? (herb-disable-comment-valid-rule-name)
test/fixtures/disabled-2.html.erb:6:35
4 │
<%# herb:disable this-rule-doesnt-exist %>
5 │
→ 6 │
<%# herb:disable all, this-rule-doesnt-exist %>
│ ~~~~~~~~~~~~~~~~~~~~~~
7 │
8 │
<%# herb:disable html-tag-name-lowercase,
│ this-rule-doesnt-exist %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [3/13] ⎯⎯⎯⎯
[warning] Unknown rule \`this-rule-doesnt-exist\`. Did you mean \`source-indentation\`? (herb-disable-comment-valid-rule-name)
test/fixtures/disabled-2.html.erb:8:55
6 │
<%# herb:disable all, this-rule-doesnt-exist %>
7 │
→ 8 │
<%# herb:disable html-tag-name-lowercase,
│ this-rule-doesnt-exist %>
│ ~~~~~~~~~~~~~~~~~~~~~~
9 │
10 │
<%# herb:disable herb %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [4/13] ⎯⎯⎯⎯
[warning] Unknown rule \`herb\`. Did you mean \`all\`? (herb-disable-comment-valid-rule-name)
test/fixtures/disabled-2.html.erb:10:30
8 │
<%# herb:disable html-tag-name-lowercase,
│ this-rule-doesnt-exist %>
9 │
→ 10 │
<%# herb:disable herb %>
│ ~~~~
11 │
12 │
<%# herb:disable disable %>
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [5/13] ⎯⎯⎯⎯
[warning] Unknown rule \`disable\`. Did you mean \`all\`? (herb-disable-comment-valid-rule-name)
test/fixtures/disabled-2.html.erb:12:30
10 │
<%# herb:disable herb %>
11 │
→ 12 │
<%# herb:disable disable %>
│ ~~~~~~~
13 │
14 │
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [6/13] ⎯⎯⎯⎯
[error] Opening tag name \`
\` instead. (html-tag-name-lowercase) [Correctable]
test/fixtures/disabled-2.html.erb:4:9
2 │ <% %> <%# herb:disable erb-no-empty-tags, html-tag-name-lowercase %>
3 │
→ 4 │
<%# herb:disable this-rule-doesnt-exist %>
│ ~~~
5 │
6 │
<%# herb:disable all, this-rule-doesnt-exist %>
Running --fix would correct this to:
test/fixtures/disabled-2.html.erb
3 │
- 4 │
<%# herb:disable this-rule-doesnt-exist %>
5 │
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [8/13] ⎯⎯⎯⎯
[error] Opening tag name \`
\` instead. (html-tag-name-lowercase) [Correctable]
test/fixtures/disabled-2.html.erb:10:9
8 │
<%# herb:disable html-tag-name-lowercase,
│ this-rule-doesnt-exist %>
9 │
→ 10 │
<%# herb:disable disable %>
Running --fix would correct this to:
test/fixtures/disabled-2.html.erb
9 │
- 10 │
<%# herb:disable herb %>
11 │
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [10/13] ⎯⎯⎯⎯
[error] Opening tag name \`
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ [11/13] ⎯⎯⎯⎯
[error] Closing tag name \`