line_endings
Every line ending matches target: lf or crlf. Mixed endings in a single file fail.
Options
Section titled “Options”| Option | Type | Required | Default | Description |
|---|---|---|---|---|
target | one of lf | crlf | yes | Required line ending style: lf or crlf. Mixed endings within a file also fail. |
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 source file with CRLF line endings under an LF policy
Section titled “A source file with CRLF line endings under an LF policy”The rule fires on this repository:
src/src/has_crlf.rssrc/pure_lf.rsfn c() {}<U+000D>fn d() {}fn a() {}fn b() {}With this .alint.yml:
version: 1rules: - id: lf-only kind: line_endings paths: "src/**/*.rs" target: lf level: erroralint check reports:
--- src/has_crlf.rs ------------------------------------------------------------ x error lf-only 1:1 line 1 does not use lf line endings
Summary (1 violation): x 1 error 0 passing * 1 failingEvery source file uses LF line endings
Section titled “Every source file uses LF line endings”This repository is compliant:
src/src/a.rssrc/b.rsfn a() {}fn b() {}fn c() {}With this .alint.yml:
version: 1rules: - id: lf-only kind: line_endings paths: "src/**/*.rs" target: lf level: erroralint check reports:
v All 1 rule(s) passed.