Repository navigation
Commit 20c5727
committed
feat(MD012): report one warning per blank-line run with its exact range
MD012 emitted one zero-width warning per excess blank line, so a run of
five blank lines produced four diagnostics, four quick fixes, and editor
markers that did not show what the fix would delete.
Each run now yields a single warning whose half-open range equals the
byte range its fix removes, line terminators included. The end-of-file
warning starts at the first trailing blank line and ends at end of file.
Messages state the counts, e.g. "(4 found, 1 allowed)", including the
higher limit derived from MD022 next to headings.
Inline suppression now uses LintWarning::covered_lines(), which treats a
range ending at column 1 as not covering that line. A disable-line
comment on the content after a run therefore does not suppress the run,
and disable-next-line directly above trailing blank lines suppresses the
whole end-of-file run rather than only a single trailing blank.1 parent 7d09be6 commit 20c5727
11 files changed
Lines changed: 394 additions & 131 deletions
File tree
- docs
- src
- rules
- utils
- tests
- character_ranges
- cli
- rules
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
105 | 118 | | |
106 | 119 | | |
107 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
455 | | - | |
| 455 | + | |
456 | 456 | | |
457 | 457 | | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
| 458 | + | |
466 | 459 | | |
467 | 460 | | |
468 | 461 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
56 | 75 | | |
57 | 76 | | |
58 | 77 | | |
| |||
0 commit comments