Skip to content

file_min_lines

File must have at least min_lines lines (\n-terminated, with an unterminated trailing segment counting as one more — wc -l semantics). Use for “README has more than a title and a TODO”.

OptionTypeRequiredDefaultDescription
min_linesinteger (>= 0)yesMinimum allowed line count.

Plus the common paths, level, id, and when fields. This table is generated from the JSON Schema; option types and defaults are authoritative.

The rule fires on this repository:

fine.md
stub.md
fine.md
# Project
A description.
Usage: run me.
stub.md
# Project
TODO

With this .alint.yml:

version: 1
rules:
- id: min-3-lines
kind: file_min_lines
paths: "**/*.md"
min_lines: 3
level: info

alint check reports:

Terminal window
--- stub.md --------------------------------------------------------------------
i info min-3-lines
file has 2 line(s); at least 3 required
Summary (1 violation):
i 1 info
0 passing * 1 failing

This repository is compliant:

README.md
README.md
# Demo
A description.
Install: `cargo install foo`.
Run: `foo`.

With this .alint.yml:

version: 1
rules:
- id: min-4-lines
kind: file_min_lines
paths: "**/*.md"
min_lines: 4
level: warning

alint check reports:

Terminal window
v All 1 rule(s) passed.