-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
astral-sh/ruff
#21508Labels
cliRelated to the command-line interfaceRelated to the command-line interface
Description
We currently exit with code 1 in cases of IO errors:
▶ ty check non-existent-file.py
WARN No python files found under the given path(s)
error[io]: `/home/shark/non-existent-file.py`: No such file or directory (os error 2)
Found 1 diagnostic
▶ echo $?
1
This is undesirable because it mixes actual diagnostics in the users code (type-checking problems) with problems when performing the check. It is useful for users to be able to distinguish these two cases.
Similarly, as @MichaReiser pointed out in a conversation, it is unlikely that someone would want to suppress IO errors using --exit-zero, but that is exactly what happens right now:
▶ ty check non-existent-file.py --exit-zero
WARN No python files found under the given path(s)
error[io]: `/home/shark/non-existent-file.py`: No such file or directory (os error 2)
Found 1 diagnostic
▶ echo $?
0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cliRelated to the command-line interfaceRelated to the command-line interface