| id | 51 |
|---|---|
| title | Section-Level Size Limits |
| status | ✅ |
Enforce size limits on individual Markdown sections to prevent oversized headings from hiding in otherwise compliant files.
- Define section boundary detection rules for heading levels.
- Add configuration for per-heading or per-pattern limits.
- Implement rule to count section length by lines.
- Document configuration and examples.
- Rule enforces size limits per heading level or heading pattern.
- Findings include the heading title and measured size.
- Limits can be configured independently of file-level limits.
- All tests pass:
go test ./... -
golangci-lint runreports no issues
Implemented as MDS036 max-section-length (named to mirror
max-file-length, since limits are measured in lines). A section
spans from its heading line up to (but not including) the next heading
line of any level, or end of file. Nested subsections are measured
independently of their parent, so the limit applies to direct content
under each heading. Lookup order for the applicable max: per-heading
regex (first match), per-level, max. Disabled by default; enable
by setting max (or any per-level / per-heading entry) to a
positive integer in .mdsmith.yml.