Closed kurtmckee closed 1 month ago
I think that is a good idea.
Instead of submitting a HUGE PR I prefer if you provide the commands you used so I can run them on my side.
Rather than using commands, I'll submit a PR with a .pre-commit-config.yaml
file and the isort config in pyproject.toml
. You'll then be able to checkout the branch and run:
# Install pre-commit in your repo git hooks so it runs before git commits complete
pre-commit install
# Run all of the pre-commit hooks against all files in the repo
pre-commit run --all
I strongly recommend running that pre-commit run --all
command several times until all of the hooks return success...sometimes pyupgrade needs to run a couple of times.
I work with pre-commit installed via pipx, but do you want it added as a development dependency? I can add that to dev-requirements.txt
while I'm in there.
(I need to turn to work items now but I'll get that PR submitted when I have an opportunity!)
I've submitted #193, which introduces a pre-commit configuration.
I'm closing this issue as my question was answered.
@LudovicRousseau I'd like to use the following code formatters on the codebase, but want to get your feedback first:
Here's an example of how black will reformat the code in
ATR.py
:Here's an example of how isort will sort imports in
setup.py
:Here's an example of how pyupgrade will update the code idioms in
Exceptions.py
:If this looks acceptable to you, I'll submit a PR that introduces a pre-commit configuration with these tools enabled.
I will strongly recommend enabling pre-commit.ci for this repo, which will have the added benefit that incoming PRs will automatically be checked for conformance with the code formatter rules. If the tools detect deviations, pre-commit.ci will update the PR with an additional commit that fixes the issue(s).