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

sds / haml-lint / 29270290596 / 21
97%
main: 97%

Build:
DEFAULT BRANCH: main
Ran 13 Jul 2026 05:26PM UTC
Files 204
Run time 33s
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:24PM UTC coverage: 97.156% (+0.003%) from 97.153%
29270290596.21

push

github

web-flow
Add corrected/correctable flags to offense output (#676)

## Summary

Brings haml-lint's output to parity with RuboCop's JSON format by adding
two per-offense flags:

- **`corrected`** — whether the offense was fixed by auto-correct
(already tracked internally, now surfaced).
- **`correctable`** — whether the offense *could* be auto-corrected
(new).

This mirrors what `rubocop -f json` reports for the same embedded Ruby
(e.g. `"corrected": false, "correctable": true`).

## Output examples

Given `- if some_var = value` in a template, `haml-lint -r json` now
emits per offense:

```json
{
  "severity": "warning",
  "message": "Lint/AssignmentInCondition: Use `==` if ...",
  "corrected": false,
  "correctable": true,
  "location": { "line": 1 },
  "linter_name": "RuboCop"
}
```

The default text reporter marks correctable-but-uncorrected lints with
`[Correctable]`, alongside the existing `[Corrected]`:

```
verify.haml:1 [W] [Correctable] RuboCop: Lint/AssignmentInCondition: Use `==` if you meant to do a comparison ...
verify.haml:2 [W] [Correctable] TrailingWhitespace: Line contains trailing whitespace
```

Running with `-a`, a fixed offense flips to `corrected: true` (and
`[Corrected]` in text):

```json
{ "message": "Line contains trailing whitespace", "corrected": true, "correctable": true, "location": { "line": 2 } }
```

## How

- `Lint` gains a `correctable` attribute alongside `corrected`.
- Base `record_lint` defaults `correctable` to the linter's
`supports_autocorrect?`, so every HAML linter is covered without editing
each file. A linter can pass `correctable: false` for offenses it can't
fix.
- The RuboCop linter threads RuboCop's own per-offense
`offense.correctable?`, correctly distinguishing cops that support
autofix from those that don't (rather than assuming the whole linter is
correctable).
- Syntax/processing errors stay `correctable: false`.

Co-authored-by: Shane da Silva <shane@dasilva.io>

6286 of 6470 relevant lines covered (97.16%)

322.84 hits per line

Source Files on job ruby3.4-haml7.2-ubuntu - 29270290596.21
  • Tree
  • List 204
  • Changed 101
  • Source Changed 5
  • Coverage Changed 101
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 29270290596
  • 1cecd28e on github
  • Prev Job for on main (#29270052965.16)
  • Next Job for on main (#29270728869.11)
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