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

sds / haml-lint / 29270052965
97%

Build:
DEFAULT BRANCH: main
Ran 13 Jul 2026 05:21PM UTC
Jobs 36
Files 102
Run time 2min
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.493% (+0.05%) from 97.448%
29270052965

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)

104 of 105 new or added lines in 5 files covered. (99.05%)

3150 of 3231 relevant lines covered (97.49%)

23031.17 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
98.21
-1.79% lib/haml_lint/linter/unnecessary_string_output.rb
Jobs
ID Job ID Ran Files Coverage
1 ruby3.3-haml7.2-ubuntu - 29270052965.1 13 Jul 2026 05:21PM UTC 204
97.15
GitHub Action Run
2 ruby3.4-haml6.2-ubuntu - 29270052965.2 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
3 ruby3.3-haml6.4-ubuntu - 29270052965.3 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
4 ruby3.3-haml7.0-ubuntu - 29270052965.4 13 Jul 2026 05:21PM UTC 204
97.15
GitHub Action Run
5 ruby4.0-rubocop1.0-ubuntu - 29270052965.5 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
6 ruby4.0-haml5.1-ubuntu - 29270052965.6 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
7 ruby3.3-rubocop1.0-ubuntu - 29270052965.7 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
8 ruby3.4-haml6.4-ubuntu - 29270052965.8 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
9 ruby4.0-haml6.3-ubuntu - 29270052965.9 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
10 ruby4.0-haml6.4-ubuntu - 29270052965.10 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
11 ruby3.3-haml5.2-ubuntu - 29270052965.11 13 Jul 2026 05:21PM UTC 204
96.87
GitHub Action Run
12 ruby3.4-haml7.1-ubuntu - 29270052965.12 13 Jul 2026 05:22PM UTC 204
97.15
GitHub Action Run
13 ruby3.4-rubocop1.0-ubuntu - 29270052965.13 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
14 ruby4.0-haml6.2-ubuntu - 29270052965.14 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
15 ruby3.3-haml5.0-ubuntu - 29270052965.15 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
16 ruby3.4-haml7.2-ubuntu - 29270052965.16 13 Jul 2026 05:22PM UTC 204
97.15
GitHub Action Run
17 ruby4.0-haml6.0-ubuntu - 29270052965.17 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
18 ruby3.4-haml5.1-ubuntu - 29270052965.18 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
19 ruby3.4-haml7.0-ubuntu - 29270052965.19 13 Jul 2026 05:22PM UTC 204
97.15
GitHub Action Run
20 ruby3.3-haml6.3-ubuntu - 29270052965.20 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
21 ruby3.4-haml5.2-ubuntu - 29270052965.21 13 Jul 2026 05:22PM UTC 204
96.87
GitHub Action Run
22 ruby4.0-haml6.1-ubuntu - 29270052965.22 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
23 ruby3.3-haml6.0-ubuntu - 29270052965.23 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
24 ruby3.4-haml6.0-ubuntu - 29270052965.24 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
25 ruby4.0-haml7.2-ubuntu - 29270052965.25 13 Jul 2026 05:22PM UTC 204
97.15
GitHub Action Run
26 ruby3.4-haml6.1-ubuntu - 29270052965.26 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
27 ruby4.0-haml7.0-ubuntu - 29270052965.27 13 Jul 2026 05:22PM UTC 204
97.15
GitHub Action Run
28 ruby4.0-haml5.2-ubuntu - 29270052965.28 13 Jul 2026 05:22PM UTC 204
96.87
GitHub Action Run
29 ruby3.3-haml5.1-ubuntu - 29270052965.29 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
30 ruby3.4-haml6.3-ubuntu - 29270052965.30 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
31 ruby4.0-haml5.0-ubuntu - 29270052965.31 13 Jul 2026 05:22PM UTC 204
97.12
GitHub Action Run
32 ruby4.0-haml7.1-ubuntu - 29270052965.32 13 Jul 2026 05:21PM UTC 204
97.15
GitHub Action Run
33 ruby3.3-haml6.1-ubuntu - 29270052965.33 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
34 ruby3.3-haml6.2-ubuntu - 29270052965.34 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
35 ruby3.3-haml7.1-ubuntu - 29270052965.35 13 Jul 2026 05:21PM UTC 204
97.15
GitHub Action Run
36 ruby3.4-haml5.0-ubuntu - 29270052965.36 13 Jul 2026 05:21PM UTC 204
97.12
GitHub Action Run
Source Files on build 29270052965
  • Tree
  • List 102
  • Changed 101
  • Source Changed 5
  • Coverage Changed 101
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #29270052965
  • 7cbc3520 on github
  • Prev Build on main (#29053294282)
  • Next Build on main (#29270290596)
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