Usage¶
Command Line¶
Reformat the given Python source files.
formate [OPTIONS] [FILENAME]...
Options
-
-c
,
--config-file
<config_file>
¶ The path or filename of the TOML configuration file to use. If a filename is given it is searched for in the current and parent directories.
- Default
formate.toml
-
-e
,
--exclude
<PATTERN>
¶ Patterns for files to exclude from formatting.
-
-v
,
--verbose
¶
Show verbose output.
-
--colour
,
--no-colour
¶
Whether to use coloured output.
-
-T
,
--traceback
¶
Show the complete traceback on error.
-
--diff
¶
Show a diff of changes made
-
--version
¶
Show the version and exit.
Arguments
-
FILENAME
¶
Optional argument(s). Default
None
As a pre-commit
hook¶
formate
can also be used as a pre-commit hook.
To do so, add the following to your
.pre-commit-config.yaml file:
- repo: https://github.com/python-formate/formate
rev: 0.6.0
hooks:
- id: formate
args:
- --verbose
The args
option can be used to provide the command line arguments shown above.
By default formate
is run with --verbose --diff