Skip to content

Content

Rule kinds in the Content family. Each rule below links to its own page with options, an example, and any auto-fix support.

RuleDescription
file_content_matchesFile contents must contain at least one match for a regex.
file_content_forbiddenFile contents must NOT match a regex.
file_headerThe first N lines must match a regex (line-oriented).
file_starts_withByte-level prefix / suffix check.
file_ends_withByte-level prefix / suffix check.
file_hashContent SHA-256 must equal the expected digest.
file_max_sizeFile must be at most max_bytes in size.
file_min_sizeFile must be at least min_bytes in size.
file_min_linesFile must have at least min_lines lines (\n-terminated, with an unterminated trailing segment counting as one more, wc -l semantics).
file_max_linesFile must have at most max_lines lines, using the same accounting as file_min_lines.
file_footerLast lines lines of each file in scope must match a regex.
file_shebangFirst line of each file in scope must match the shebang regex.
file_is_textContent is detected as text (magic bytes + UTF-8 validity check), fails on binary files matched by paths.
file_is_asciiEvery byte in the file must be < 0x80 (pure ASCII), except codepoints listed in allow:.