Skip to content

no_illegal_windows_names

Reject path components Windows can’t represent:

  • Reserved device names (CON, PRN, AUX, NUL, COM1–COM9, LPT1–LPT9) — case-insensitive, regardless of extension. con.txt fails; COM10 and confused correctly pass.
  • Trailing dots (foo.) or trailing spaces (foo ) — Windows silently strips these on checkout.
  • Reserved chars: <, >, :, ", |, ?, *.

This rule takes no kind-specific options.

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

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
NUL
README.md
con.txt
trailing_dot.
README.md
# fine

With this .alint.yml:

version: 1
rules:
- id: no-win-reserved
kind: no_illegal_windows_names
paths: "**"
level: error

alint check reports:

Terminal window
--- 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 failing
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: 1
rules:
- id: no-win-reserved
kind: no_illegal_windows_names
paths: "**"
level: error

alint check reports:

Terminal window
v All 1 rule(s) passed.