Skip to content
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

Add a pre-commit configuration #193

Closed
wants to merge 1 commit into from

Conversation

kurtmckee
Copy link
Contributor

@kurtmckee kurtmckee commented Sep 27, 2024

This PR introduces a pre-commit configuration file.

To use pre-commit, install the tool, perhaps using pipx or perhaps adding it to a virtual environment you use for the repository.

pipx install pre-commit

Then, run this command to install the tool as a git pre-commit hook:

pre-commit install

Then, whenever you modify a file (or files) in the repository, pre-commit will run the configured hooks against the modified files. If the files are modified by the hooks, the git commit will fail and you'll have an opportunity to review and stage the changes made by the hooks.


To format the files in this repo, you can run this command (but be aware that pyupgrade will need to be run three times because there is a specific line in ClassLoader.py that pyupgrade incrementally updates).

pre-commit run -a
pre-commit run -a
pre-commit run -a

I strongly recommend enabling pre-commit.ci, which -- like coveralls -- will automatically run an additional action against incoming PRs. The difference is that pre-commit.ci will automatically push an additional commit to the PR if one of the modified files doesn't conform to the code format rules.

@coveralls
Copy link

coveralls commented Sep 27, 2024

Coverage Status

coverage: 60.788%. remained the same
when pulling a8eb7c0 on kurtmckee:add-pre-commit
into 1e3c419 on LudovicRousseau:master.

@LudovicRousseau
Copy link
Owner

Merged in 85ed603

Thanks

@kurtmckee kurtmckee deleted the add-pre-commit branch October 2, 2024 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants