Skip to content

file_header

The first N lines must match a regex (line-oriented). For a byte-level prefix check, prefer file_starts_with.

- id: spdx-header
kind: header
paths: "src/**/*.rs"
pattern: "^// SPDX-License-Identifier: MIT"
level: error

Fix: file_prepend — inject declared content at the top (preserves UTF-8 BOM).

OptionTypeRequiredDefaultDescription
linesinteger (>= 1)20Number of leading lines to consider.
patternstringyesRust regex. The first lines lines of each file in scope must match.

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