Skip to content

chore: add comment formatting pre-commit hook script #1126

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

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

benmss
Copy link
Member

@benmss benmss commented Jul 21, 2025

Summary

This PR adds a new pre-commit hook that checks the grammar/formatting of Python comments.

Description of changes

The script attempts to correct comments so that they start with a capital letter and end with a full stop where applicable. This is achieved by examination of the space tokenised contents of each comment.

As implemented, the new hook checks any Python source files that were changed and reside within the src/macaron or tests directories. All source files that could be changed by this script have been modified and included as part of this PR. Some files were manually edited to overcome script limitations, or to be excluded from checking entirely.

Information on working with the script (including disabling it for certain files) has been added to the style guide.

benmss added 5 commits July 21, 2025 21:03
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
@benmss benmss added this to the Release version 0.18.0 milestone Jul 21, 2025
@benmss benmss self-assigned this Jul 21, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 21, 2025
Signed-off-by: Ben Selwyn-Smith <benselwynsmith@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant