Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions internal/rules/MDS036-max-section-length/bad/per-heading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
settings:
max: 0
per-heading:
- pattern: "^Changelog$"
max: 2
diagnostics:
- line: 3
column: 1
message: 'section "## Changelog" too long (5 > 2)'
---
# Overview

## Changelog

- entry one
- entry two
- entry three
17 changes: 17 additions & 0 deletions internal/rules/MDS036-max-section-length/good/per-heading.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
settings:
max: 0
per-heading:
- pattern: "^Short$"
max: 4
---
# Title

## Short

One line.

## Longer section with no matching pattern

This section is longer but stays untouched because only headings
matching `^Short$` are capped and the default `max` is zero.
2 changes: 1 addition & 1 deletion plan/51_section-level-size-limits.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ to prevent oversized headings from hiding in otherwise compliant files.

1. [x] Define section boundary detection rules for heading levels.
2. [x] Add configuration for per-heading or per-pattern limits.
3. [x] Implement rule to count section length by lines or tokens.
3. [x] Implement rule to count section length by lines.
4. [x] Document configuration and examples.

## Acceptance Criteria
Expand Down
Loading