Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 1.32 KB

File metadata and controls

38 lines (30 loc) · 1.32 KB
id 51
title Section-Level Size Limits
status

Section-Level Size Limits

Goal

Enforce size limits on individual Markdown sections to prevent oversized headings from hiding in otherwise compliant files.

Tasks

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

Acceptance Criteria

  • 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 run reports no issues

Notes

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.