Skip to content

Commit

Permalink
Fix format strings for the cli help
Browse files Browse the repository at this point in the history
  • Loading branch information
sodul committed Mar 12, 2022
1 parent bcb1dfd commit 2fd0c30
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Gray stands on the shoulders of giants:

```
usage:
gray myapp.py
gray myproj/ tests/
gray --log-level debug --formatters isort,unify ~/app
gray myapp.py
gray myproj/ tests/
gray --log-level debug --formatters isort,unify ~/app
Less uncompromising Python code formatter.
Expand All @@ -35,9 +35,10 @@ optional arguments:
--exclude EXCLUDE A regular expression matching files and directories that should be
excluded from formatting. Passing an explicit empty value means not paths
get excluded. Use '/' as directory separator, including on Windows.
[default: {DEFAULT_EXCLUDES}] (default: (.*/)?(\.direnv|\.eggs|\.git|\.hg|
\.mypy_cache|\.nox|\.tox|\.venv|venv|\.svn|_build|buck-
out|build|dist|__pypackages__)$)
[default: (.*/)?(\.direnv|\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.ven
v|venv|\.svn|_build|buck-out|build|dist|__pypackages__)$] (default: (.*/)?
(\.direnv|\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|venv|\.svn|_bu
ild|buck-out|build|dist|__pypackages__)$)
--extend-exclude EXTEND_EXCLUDE
An additional regular expression to use besides --exclude. This allows to
keep the default regex from --exclude. (default: None)
Expand All @@ -51,8 +52,8 @@ Logging options:
Formatters options:
-f FORMATTERS, --formatters FORMATTERS
Enabled formatters separated by comma (optional: black)
(default: add-trailing-comma,autoflake,fixit,isort,pyupgrade,trim,unify)
Enabled formatters separated by comma (optional: black) (default: add-
trailing-comma,autoflake,fixit,isort,pyupgrade,trim,unify)
--min-python-version MIN_PYTHON_VERSION
Minimum python version to support (default: (3, 9))
Expand Down Expand Up @@ -136,11 +137,10 @@ black options:
--black-skip-string-normalization BLACK_SKIP_STRING_NORMALIZATION
Don't normalize string quotes or prefixes. (default: False)
Args that start with '--' (eg. --pool-size) can also be set in a config file
(/Users/apple/.gray or /etc/gray.conf or ./gray.conf). Config file syntax
allows: key=value, flag=true, stuff=[a,b,c] (for details, see syntax at
https://goo.gl/R74nmi). If an arg is specified in more than one place, then
commandline values override config file values which override defaults.
Args that start with '--' (eg. --exclude) can also be set in a config file (/Users/stephane/.gray
or /etc/gray.conf or ./gray.conf). Config file syntax allows: key=value, flag=true, stuff=[a,b,c]
(for details, see syntax at https://goo.gl/R74nmi). If an arg is specified in more than one place,
then commandline values override config file values which override defaults.
```


Expand Down
4 changes: 2 additions & 2 deletions gray/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_parser() -> configargparse.ArgumentParser:
help="A regular expression matching files and directories that should"
" be excluded from formatting. Passing an explicit empty value"
" means not paths get excluded. Use '/' as directory separator,"
" including on Windows. [default: {DEFAULT_EXCLUDES}]",
f" including on Windows. [default: {DEFAULT_EXCLUDES}]",
default=DEFAULT_EXCLUDES,
)

Expand Down Expand Up @@ -93,7 +93,7 @@ def get_parser() -> configargparse.ArgumentParser:
"-f",
"--formatters",
help="Enabled formatters separated by comma"
" (optional: {OPTIONAL_FORMATTERS_NAMES})",
f" (optional: {OPTIONAL_FORMATTERS_NAMES})",
type=parse_formatters,
default=FORMATTERS_NAMES,
)
Expand Down

0 comments on commit 2fd0c30

Please sign in to comment.