jendrikseipp / vulture

Find dead Python code
MIT License
3.38k stars 148 forks source link

Dedicated exit code for "Dead code found" #308

Closed kevinr-electric closed 1 year ago

kevinr-electric commented 1 year ago

Right now, the 1 exit code shares 2 meanings:

in the first case, vulture successfully ran, but in the second case it failed. This means that a script using Vulture can't use the exit code to make a distinction between those 2 cases. Using a dedicated exit code for "Dead code found" would allow scripts to distinguish between those 2 cases.

I'd like to propose using exit code 3 to mean "Dead code found", and removing that meaning from exit code 1. So in a table:

Exit code Description
0 No dead code found
1 Invalid input (file missing, syntax error, wrong encoding)
2 Invalid command line arguments
3 Dead code found

I'm fine with any number, I just want the "Dead code found" case to have a dedicated exit code. I'd be happy to create a PR to do this, but first I wanted to check if this would be something the maintainers would be open to.

jendrikseipp commented 1 year ago

I like the proposed change! Happy to review a PR for this. Please make sure to update the exit code table in the README.md file.

jendrikseipp commented 1 year ago

Fixed in #319.