Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing file return value should be 2 like in Black #592

Closed
akaihola opened this issue Jul 28, 2024 · 0 comments · Fixed by #595
Closed

Missing file return value should be 2 like in Black #592

akaihola opened this issue Jul 28, 2024 · 0 comments · Fixed by #595
Assignees
Labels
enhancement New feature or request

Comments

@akaihola
Copy link
Owner

If a file given on the command line doesn't exist, Darker exits with a return value of 1. This is the same return value as returned from darker --check if the file needs reformatting.

It would be better to match Black's return value of 2 when a file doesn't exist.

Darker 2.1.1's behavior:

$ darker /tmp/foobar.py ; echo $?
argument PATH: Error: Path(s) '/tmp/foobar.py' do not exist in the working tree
1

Black's behavior:

$ black /tmp/foobar.py ; echo $?
Usage: black [OPTIONS] SRC ...
Try 'black -h' for help.

Error: Invalid value for 'SRC ...': Path '/tmp/foobar.py' does not exist.
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

1 participant