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 pre-commit to run codespell and other tools #135

Closed
wants to merge 1 commit into from

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Aug 30, 2024

Use the https://pre-commit.com tool to set up localhost and GitHub Actions testing of codespell and other tools.

Enable some standard hooks while leaving others commented out to facilitate enabling them in future pull requests.

Migrate the codespell settings into pyproject.toml and add hooks for validation and formatting of this file.

https://github.com/pre-commit-ci/lite-action is used to run the tests on pull requests. https://pre-commit.ci does more.

# - id: end-of-file-fixer
# - id: fix-encoding-pragma
# - id: no-commit-to-branch
# - id: trailing-whitespace
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a pre-commit expert. Does enabling these hooks install the corresponding packages?

Copy link
Contributor Author

@cclauss cclauss Aug 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are Python files that are installed as a single package. Each file is less than 5k. Commenting merely determines if they are run or not.

https://github.com/pre-commit/pre-commit-hooks/tree/main/pre_commit_hooks

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@cclauss cclauss requested a review from mattip August 30, 2024 12:55
@mattip
Copy link
Member

mattip commented Aug 31, 2024

Can we close this now that #137 is merged?

@cclauss cclauss closed this Aug 31, 2024
@cclauss cclauss deleted the pre-commit branch August 31, 2024 17:53
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.

2 participants