Content
Rule kinds in the Content family. Each entry below has its own page with options, an example, and any auto-fix support.
file_content_matches— File contents must contain at least one match for a regex.file_content_forbidden— File contents must NOT match a regex.file_header— The first N lines must match a regex (line-oriented).file_starts_with— Byte-level prefix / suffix check.file_ends_with— Byte-level prefix / suffix check.file_hash— Content SHA-256 must equal the expected digest.file_max_size— File must be at mostmax_bytesin size.file_min_size— File must be at leastmin_bytesin size.file_min_lines— File must have at leastmin_lineslines (\n-terminated, with an unterminated trailing segment counting as one more —wc -lsemantics).file_max_lines— File must have at mostmax_lineslines, using the same accounting asfile_min_lines.file_footer— Lastlineslines of each file in scope must match a regex.file_shebang— First line of each file in scope must match theshebangregex.file_is_text— Content is detected as text (magic bytes + UTF-8 validity check) — fails on binary files matched bypaths.file_is_ascii— Every byte in the file must be < 0x80.