You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of end-user running pyupgrade --py37-plus, we can utilise tools section in pyproject.toml like:
[tool.pyupgrade]
py37-plus = true
and just run the command pyupgrade
Implementation requirements: Usual requirements for finding pyproject.toml in parents folders if current directory is within the python project/packages applies. Single VCS repository may contain multiple python packages too.
Motivation
We have pyupgrade wired into pre-commit hook, but the hook itself is optional in large legacy code as it introduces huge diff. Without pre-commit hook, the onus falls back on developer to remember arguments for each projects or peek into .pre-commit-config.yaml.
isort has a similar functionality, that after following in pyproject.toml
[tool.isort]
profile = "black"
developer can simply run isort instead of isort --profile black.
The text was updated successfully, but these errors were encountered:
I know this is an old issue, but would you consider a pull request using ConfigArgParse? (Or a similar library?) This library handles multiple file formats (including INI and TOML, the latter using the now-standard toml library), CLI argument parsing, and merging CLI options with config file options. And it uses argparse under the covers, so the existing parser definition could be reused.
If I understand correctly based on the discussion in asottile/reorder-python-imports#101, this would address your primary concern around adding a configuration file, which is the amount of code and effort dedicated to parsing—which I completely understand. I hope that using a library like this would be an acceptable option.
I would personally find a configuration file very valuable for linting. It's important to make sure everyone's using the same settings to avoid noisy git diffs, IDE noise, and spurious CI failures. We can use scripts and makefiles to provide CLI arguments, but they're easy to miss or ignore; to ignore a configuration file, one would need to add CLI arguments—and so the path of least effort is also the most correct.
Feature request
Instead of end-user running
pyupgrade --py37-plus
, we can utilise tools section in pyproject.toml like:and just run the command
pyupgrade
Implementation requirements: Usual requirements for finding pyproject.toml in parents folders if current directory is within the python project/packages applies. Single VCS repository may contain multiple python packages too.
Motivation
We have
pyupgrade
wired intopre-commit
hook, but the hook itself is optional in large legacy code as it introduces huge diff. Without pre-commit hook, the onus falls back on developer to remember arguments for each projects or peek into.pre-commit-config.yaml
.isort
has a similar functionality, that after following inpyproject.toml
developer can simply run
isort
instead ofisort --profile black
.The text was updated successfully, but these errors were encountered: