• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sds / haml-lint / 29270052965 / 31
97%
main: 97%

Build:
DEFAULT BRANCH: main
Ran 13 Jul 2026 05:22PM UTC
Files 204
Run time 12s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Jul 2026 05:20PM UTC coverage: 97.122% (+0.06%) from 97.065%
29270052965.31

push

github

web-flow
Add unsafe autocorrections (#675)

## Summary

Adds unsafe auto-correction (applied only under `-A` /
`--auto-correct-all`) to four Haml-level linters that previously flagged
issues without being able to fix them. Each correction is
behavior-preserving in the common case and **bails out (reporting
without correcting)** whenever it can't guarantee an equivalent rewrite.

Along the way, two latent bugs were found and fixed (see below).

## Linters gaining auto-correction

| Linter | Before | After |
| --- | --- | --- |
| **UnnecessaryStringOutput** | `%tag= "Some #{x}"` | `%tag Some #{x}` |
| **HtmlAttributes** | `%tag(href="x" data=foo)` | `%tag{ "href" => "x",
"data" => foo }` |
| **ConsecutiveSilentScripts** | consecutive `- a` / `- b` / `- c` | a
single `:ruby` filter block |
| **AlignmentTabs** | `%p⇥Hello` | `%p Hello` |

### Safety notes per linter

- **UnnecessaryStringOutput** — rebuilds the plain text from the parsed
string literal, keeping `#{...}` interpolation and escaping literal `#{`
so Haml won't interpolate it. Keeps the existing equivalence guards
(escape sequences, significant whitespace, reserved leading characters)
and leaves `!=`/`~` markers alone.
- **HtmlAttributes** — builds the hash from Haml's already-validated
parse output. Skips (still reports) cases that can't be converted
losslessly: an existing `{...}` group, the `.class`/`#id` shorthand, or
a multiline attribute list. Adds `TagNode#static_attributes` to expose
the parsed static attributes.
- **ConsecutiveSilentScripts** — merges a run into an equivalent `:ruby`
filter, preserving indentation and variable scope. Only merges
single-line scripts on contiguous lines.
- **AlignmentTabs** — collapses each run of alignment tabs into one
space, leaving indentation tabs untouched.

## Bug fixes included

- **`AlignmentTabs` was never running.** It was missing its
`LinterRegistry` registration, so it was never selected during real runs
despite being `enabled: true` in the default ... (continued)

6276 of 6462 relevant lines covered (97.12%)

318.34 hits per line

Source Files on job ruby4.0-haml5.0-ubuntu - 29270052965.31
  • Tree
  • List 204
  • Changed 101
  • Source Changed 5
  • Coverage Changed 101
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 29270052965
  • 7cbc3520 on github
  • Prev Job for on main (#29053294282.7)
  • Next Job for on main (#29270290596.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc