-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🧰👌 Use pre-commit
instead of tox -e style
to run all CQA tools
#288
Comments
@s-weigand your issue title made me think |
Oh… So it's hidden away in |
Yeah, that is what makes the project's tooling less obvious in general to people who have seen many projects and just guess tooling based on files. But without version pinning IMHO running CQA becomes unpredictable.
This is why I'm a huge
|
Yeah, I've been using it pre-commit for over 8 years, if not more myself. Always wrapped with tox, and sometimes with pre-commit.ci in addition to that. By the way, I saw Bernát tweeting the other day that he finally implemented a TOML config for tox. Need to check that out. tox-dev/tox#3353. FWIW, here's my recent most integrated project example with "lock files" et al: https://github.com/ansible/awx-plugins/blob/ae95d1b/tox.ini. |
As for discovering the tox envs, there's an old (tox 3) command |
@s-weigand Cut the PR if you want. I don't have a strong opinion one way or the other so long as all the tools get executed when they need to. |
There are some inconsistency between the linting tools in the I can try to clean this up. @weibullguy Are there any strong opinions which tools should run and which one maybe can be replaced? (Lot's of the checks can be done by ruff now for example) |
Currently, this project has 2 ways to run CQA tools:
tox -e style
pre-commit
To a new contributor, it might not be very clear how to run CQA tools.
Please don't take this the wrong way this is just my contributor experience it isn't meant as an attack.
I know first-hand that time for a FOSS maintainer is stretched VERY thin, sometimes you need to make hard calls like "tests pass, just linting fails so let's merge it, we will fix it later" and that typically no maintainer gets the praise that they deserve.
So thanks maintainers to not let a super nice project die and keeping it alive ❤️
My experience as a first-time contributor:
pre-commit
git hooks (pre-commit install
)pre-commit run -a
(as I usually do) to populate its cache with the tooling versions of this projectpre-commit
git hooks (pre-commit uninstall
)do-lint
workflow failstox.ini
) and runtox -e style
locallytox -e style
also fails in a clean clone because of unpinned versions and tooling updatesruff
in.pre-commit-config.yaml
was very outdated I pinned it to that version in the tox env (that version of the hook used a sys executable since it didn't define a pyproject.toml to pin the version) this should "just fix it" right?pycodestyle
also has an error because linting on the default branch was broken since Aug 9, 2023Advantages of running all CQA with
pre-commit
:pre-commit autoupdate
)Disadvantages of running all CQA with
pre-commit
:Alternative:
Remove the
.pre-commit-config.yaml
and use atox.ini
, so experienced python project contributors know how to contribute even without a contributing guide (at least I did see a guide prominently mentioned)I know given my PR it might seem like "Given this issue why do you advertise for
pre-commit
?", but this is the first time that I experienced a problem that wouldn't have happened the same way with a freshvenv
ortox
.While I have seen far more issues running tooling outside of
pre-commit
(e.g. see above).So if maintainers are ok with fully changing to
pre-commit
as the CQA runner I would be happy to make a PR for this transition.The text was updated successfully, but these errors were encountered: