file_footer
Last lines lines of each file in scope must match a regex. Mirror of file_header anchored at the end of the file. Use for license footers, signed-off-by trailers, generated-file sentinels.
Fix: file_append — append a declared content. With no fix declared, violations are unfixable.
Options
Section titled “Options”| Option | Type | Required | Default | Description |
|---|---|---|---|---|
lines | integer (>= 1) | 20 | Number of trailing lines to consider. | |
pattern | string | yes | Rust regex. The last lines lines of each file 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.
Example
Section titled “Example”A file missing its license footer
Section titled “A file missing its license footer”The rule fires on this repository:
src/src/missing.rssrc/ok.rsfn b() {}// no footer herefn a() {}// Licensed under the Apache License, Version 2.0With this .alint.yml:
version: 1rules: - id: license-footer kind: file_footer paths: "src/**/*.rs" pattern: "Licensed under the Apache License" lines: 3 level: warningalint check reports:
--- src/missing.rs ------------------------------------------------------------- ! warning license-footer last 3 line(s) do not match required footer /Licensed under the Apache License/
Summary (1 violation): ! 1 warning 0 passing * 1 failingEvery file ends with the license footer
Section titled “Every file ends with the license footer”This repository is compliant:
src/src/a.rssrc/b.rsfn a() {}
// Licensed under the Apache License, Version 2.0fn b() {}// Licensed under the Apache License, Version 2.0With this .alint.yml:
version: 1rules: - id: license-footer kind: file_footer paths: "src/**/*.rs" pattern: "Licensed under the Apache License" lines: 3 level: warningalint check reports:
v All 1 rule(s) passed.