I would like to run some of the built-in hooks available from the pre-commit package from the command line, not as hooks but just from the command line to spot clean files as necessary.
For example, if I want to run black on an arbitrary file in my project, I can just run it with black [directory]
command.
I don't see in the documentation what the entry commands for built-in hooks such as trailing-whitespace
are.
For example, I would like to clean up trailing whitespace in foo.py
by just typing trailing-whitespace foo.py
. This does not work, however.
How would one go about doing this?
As a side note, this should also be possible if running hooks as local
with pre-commit installed in a local env.