Enable the `directory` args option in addition to `filenames`
amirhessam88 opened this issue · 3 comments
amirhessam88 commented
Hey @asottile ; I am trying to use add-trailing-comma
as part of formatting and use flake8-comma
as check against it. I can see this as help:
usage: add-trailing-comma [-h] [--exit-zero-even-if-changed] [--py35-plus] [--py36-plus] [filenames ...]
My understanding is the directory
option is not currently available. I have seen black
or isort
have this ability:
--src SRC_PATHS, --src-path SRC_PATHS
Add an explicitly defined source path (modules within src paths have their imports automatically categorized as first_party). Glob expansion (`*` and `**`) is supported for
this option.
I was wondering maybe this can be a very helpful feature. I also appreciate it if you direct me how can I apply this on a directory. For example, lets say I have src/
and tests/
and I wanna apply add-trailing-comma
to all .py
files.
Currently, I am running the snippet below (I use poetry
) in my formatting
scripts:
poetry run add-trailing-comma src/**/*.py tests/**/*.py
asottile commented
search the issue tracker
amirhessam88 commented