Initially, we want to understand which linter is doing what. One way to do this is to comment out all the linters in .pre-commit-config.yaml except the one you want to focus on. That's not the best experience.
We found the below command to work best for the above flow
tox -e pre-commit -- --all-files pyupgrade where pyupgrade is found in .pre-commit-config.yaml in id, under hooks
Note that if you are googling around you might think the command you want is tox -e pre-commit -- pyupgrade but if you look in tox.ini you will find the below. Note the {posargs:--all-files} {posargs} is referring to the portion after --, the {:--all-files} is the default value to use if no position args are specified. It looks like the intent of this version of commands is to easily allow for running all linters against a single or few command-line specified files. In our initial exploration use case, we want to run one linter against all files.
[testenv:pre-commit]
description = Run the quality checks under {basepython}
commands =
{envpython} -Im \
pre_commit run \
--show-diff-on-failure \
{posargs:--all-files}
Initially, we want to understand which linter is doing what. One way to do this is to comment out all the linters in
.pre-commit-config.yamlexcept the one you want to focus on. That's not the best experience.We found the below command to work best for the above flow
tox -e pre-commit -- --all-files pyupgradewherepyupgradeis found in.pre-commit-config.yamlinid, underhooksNote that if you are googling around you might think the command you want is
tox -e pre-commit -- pyupgradebut if you look intox.iniyou will find the below. Note the{posargs:--all-files}{posargs}is referring to the portion after--, the{:--all-files}is the default value to use if no position args are specified. It looks like the intent of this version ofcommandsis to easily allow for running all linters against a single or few command-line specified files. In our initial exploration use case, we want to run one linter against all files.