-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
A-lintArea: New lintsArea: New lints
Description
What it does
If the user uses a bare dos device name such as aux
, windows will convert it to \\.\aux
(the aux device). This may be surprising. Clippy could warn the user and suggest they explicitly use \\.\aux
if that was intended. Using .\aux
could also suppress this lint.
The DOS device names are (case insensitive):
- AUX
- CON
- CONIN$
- CONOUT$
- COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, COM², COM³, COM¹
- LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9, LPT², LPT³, LPT¹
- NUL
- PRN
Lint Name
bare_dos_device_name
Category
suspicious
Advantage
Avoids unexpected and surprising path transformations.
Drawbacks
This is platform specific behaviour.
Example
File::open("aux");
Could be written as:
File::open(r"\\.\aux");
Or
File::open("./aux");
Metadata
Metadata
Assignees
Labels
A-lintArea: New lintsArea: New lints