jendrikseipp / vulture

Find dead Python code
MIT License
3.41k stars 150 forks source link

Print a success message to stdout #239

Closed exhuma closed 3 years ago

exhuma commented 3 years ago

Description

I usually run vulture in an auto re-running sub-shell, and because vulture neither prints a startup, nor a status-message on success I can never tell whether vulture has actually run or not.

This change adds a simple status message on successful run. I did not add a failure message because this is already covered by the normal printout from vulture.

At first I simply wrote done, but made it a bit more verbose to make it more clear that the message comes from vulture. I was alternatively thinking of making it [vulture] done but I think the "normal/natural" English I used makes it more consistent with the exiting messages.

jendrikseipp commented 3 years ago

I appreciate the effort, but being silent when there is nothing to report is part of the Unix philosophy (http://www.linfo.org/rule_of_silence.html). Also, related tools such as flake8 or pycodestyle also print nothing when there are no warnings.

RJ722 commented 3 years ago

@exhuma If you still want the same output, you might can alias vulture with a shell script which looks a bit like this:

output=`vulture "$@"`

if [ -z "$output" ]; then
    echo "Successfully finished. No unused code detected."
else
    echo "$output"
fi