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

Initial version of pre-commit hooks #1

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

krish2718
Copy link

This has standard checks that are used in BW org across repositories.

@bwt-sloanj bwt-sloanj self-assigned this Dec 12, 2023
@krish2718 krish2718 marked this pull request as draft December 12, 2023 19:16
@krish2718 krish2718 force-pushed the add_basic_hooks branch 5 times, most recently from fa35b75 to c35f2d7 Compare December 12, 2023 19:44
@krish2718 krish2718 marked this pull request as ready for review December 12, 2023 20:03
Copy link
Contributor

@bwt-sloanj bwt-sloanj left a comment

Choose a reason for hiding this comment

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

Since this is being adapted from the internal check_commit.py it is worth bearing in mind that this hook is currently only implementing the checkpatch part of that script - the python function check_commit_message() isn't part of it (probably something I cut out). It therefore needs to be considered if this hook needs to be expanded to also do those checks, or if another hook could do those, or if they aren't wanted for this.

Also, I appreciate that in reviewing this that I am in effect requesting changes to code that you didn't write yourself, and in some cases that I wrote, but what I gave you wasn't complete and we have also migrated Python versions since then.

README.md Outdated Show resolved Hide resolved
bw_check_commit_hook/__init__.py Outdated Show resolved Hide resolved
bw_check_commit_hook/__init__.py Outdated Show resolved Hide resolved
bw_check_commit_hook/__init__.py Outdated Show resolved Hide resolved
bw_check_commit_hook/__init__.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
bw_check_commit_hook/__init__.py Outdated Show resolved Hide resolved
bw_check_commit_hook/__init__.py Outdated Show resolved Hide resolved
bw_check_commit_hook/__init__.py Outdated Show resolved Hide resolved
bw_check_commit_hook/data/spelling.txt Outdated Show resolved Hide resolved
@krish2718
Copy link
Author

It therefore needs to be considered if this hook needs to be expanded to also do those checks, or if another hook could do those, or if they aren't wanted for this.

Well, the per-commit checks are too specific to BWT, so, IMHO, we should drop that for now, and as a first cut stick with checkpatch + spellchecks (codespell). And also, we can just use gitlint instead of custom checking, that can be another hook in this repo added later.

@krish2718 krish2718 force-pushed the add_basic_hooks branch 4 times, most recently from 360b447 to b624d18 Compare December 28, 2023 16:28
.pre-commit-config.yaml Outdated Show resolved Hide resolved
bw_check_commit_hook/data/checkpatch.yaml Outdated Show resolved Hide resolved
@krish2718 krish2718 force-pushed the add_basic_hooks branch 7 times, most recently from daadc5e to 261f1b8 Compare January 2, 2024 15:47
tests/test_config.py Outdated Show resolved Hide resolved
checkpatch_hook/data/checkpatch.yaml Outdated Show resolved Hide resolved
checkpatch_hook/__init__.py Outdated Show resolved Hide resolved
checkpatch_hook/__init__.py Outdated Show resolved Hide resolved
checkpatch_hook/__init__.py Outdated Show resolved Hide resolved
checkpatch_hook/__init__.py Outdated Show resolved Hide resolved
checkpatch_hook/__init__.py Outdated Show resolved Hide resolved
checkpatch_hook/__init__.py Outdated Show resolved Hide resolved
@krish2718 krish2718 force-pushed the add_basic_hooks branch 2 times, most recently from 4e194bb to 6c98bf1 Compare January 4, 2024 19:45
.pre-commit-hooks.yaml Outdated Show resolved Hide resolved
@krish2718 krish2718 force-pushed the add_basic_hooks branch 2 times, most recently from b7e8b6d to 8e2223f Compare January 8, 2024 11:29
@krish2718 krish2718 force-pushed the add_basic_hooks branch 2 times, most recently from 754b214 to f51ab10 Compare January 8, 2024 13:02
checkpatch_hook/__init__.py Show resolved Hide resolved
checkpatch_hook/__init__.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
.pre-commit-config.yaml Outdated Show resolved Hide resolved
Chaitanya Tata added 2 commits January 10, 2024 19:52
This has standard checks that are used in BW org across repositories.
For now checkpatch is only added.

Signed-off-by: Chaitanya Tata <[email protected]>
The actions does:
  * Run pre-commit hook
  * Run python unit tests

Signed-off-by: Chaitanya Tata <[email protected]>
@bwt-sloanj bwt-sloanj merged commit 0937a22 into bluwireless:main Jan 10, 2024
@krish2718 krish2718 deleted the add_basic_hooks branch January 10, 2024 14:30
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