final_newline
File must end with a single \n. Fixable via file_append_final_newline.
Options
Section titled "Options"This rule takes no kind-specific options.
Plus the common paths, level, id, when, and expect_matches fields. This table is generated from the JSON Schema; option types and defaults are authoritative.
Example
Section titled "Example"A Markdown file missing its trailing newline
Section titled "A Markdown file missing its trailing newline"The rule fires on this repository:
- docs/
- docs/clean.md✓
- docs/missing.md
✗ error eof
file does not end with a newline
# Hi# No newlineWith this .alint.yml:
version: 1rules: - id: eof kind: final_newline paths: "docs/**/*.md" level: erroralint check reports:
--- docs/missing.md ------------------------------------------------------------ x error eof file does not end with a newline
Summary (1 violation): x 1 error 0 passing * 1 failingEvery file ends with a trailing newline
Section titled "Every file ends with a trailing newline"This repository is compliant:
- docs/
- docs/a.md✓
- docs/b.md✓
- docs/empty.md✓
# HiHelloworldWith this .alint.yml:
version: 1rules: - id: eof kind: final_newline paths: "docs/**/*.md" level: erroralint check reports:
v All 1 rule(s) passed.