no_illegal_windows_names
Reject path components that Windows cannot represent.
The rejected forms are:
- Reserved device names (
CON,PRN,AUX,NUL,COM1–COM9,LPT1–LPT9) — case-insensitive, regardless of extension.con.txtfails;COM10andconfusedcorrectly pass. - Trailing dots (
foo.) or trailing spaces (foo) — Windows silently strips these on checkout. - Reserved chars:
<,>,:,",|,?,*.
Per Microsoft's naming rules the check also rejects COM0 / LPT0 and the superscript-digit ports (COM¹, COM², COM³, LPT¹, LPT², LPT³); a reserved name followed by spaces before its extension (CON .txt); control characters U+0000 to U+001F (tab included); and a \ inside a path component (a separator on Windows).
Options
Section titled "Options"This rule takes no kind-specific options.
Plus the common paths, level, id, when, scope_filter, and expect_matches fields. This table is generated from the JSON Schema; option types and defaults are authoritative.
Example
Section titled "Example"Files using reserved Windows device names and a trailing dot
Section titled "Files using reserved Windows device names and a trailing dot"The rule fires on this repository:
- COM1.md
✗ error no-win-reserved
clashes with a Windows reserved device name: "COM1.md"
- NUL
✗ error no-win-reserved
clashes with a Windows reserved device name: "NUL"
- README.md✓
- con.txt
✗ error no-win-reserved
clashes with a Windows reserved device name: "con.txt"
- trailing_dot.
✗ error no-win-reserved
Windows strips trailing dots on checkout: "trailing_dot."
# fineWith this .alint.yml:
version: 1rules: - id: no-win-reserved kind: no_illegal_windows_names paths: "**" level: erroralint check reports:
--- COM1.md -------------------------------------------------------------------- x error no-win-reserved clashes with a Windows reserved device name: "COM1.md"
--- NUL ------------------------------------------------------------------------ x error no-win-reserved clashes with a Windows reserved device name: "NUL"
--- con.txt -------------------------------------------------------------------- x error no-win-reserved clashes with a Windows reserved device name: "con.txt"
--- trailing_dot. -------------------------------------------------------------- x error no-win-reserved Windows strips trailing dots on checkout: "trailing_dot."
Summary (4 violations): x 4 errors 0 passing * 1 failingNames that resemble reserved Windows names but stay legal
Section titled "Names that resemble reserved Windows names but stay legal"This repository is compliant:
- COM10.cfg✓
- README.md✓
- src/
- src/controllers.rs✓
- src/lib.rs✓
With this .alint.yml:
version: 1rules: - id: no-win-reserved kind: no_illegal_windows_names paths: "**" level: erroralint check reports:
v All 1 rule(s) passed.