[WIP] - feat: add pre-commit framework #5078
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Official -> "Git hook scripts are useful for identifying simple issues before submission to code review. We run our hooks on every commit to automatically point out issues in code such as missing semicolons, trailing whitespace, and debug statements. By pointing these issues out before code review, this allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks."
https://pre-commit.com/
Description
Using a
pre-commit
framework speeds up development as a lot of tests can be run on the local machine giving instant feedback. So we don't have to wait for the CI / GitHub actions to run to get feedback. The pre-commit automatically fixes some of the issues when you dogit commit
and if there are any issues the tests are marked asred
failed and the commit fails. Then you will need to commit again so that all the tests passgreen
.There are many more pre-commit checks listed here -> https://pre-commit.com/hooks.html
Lets get this PR merged and then I will look at adding more pre-commit tests 👍
The next image shows some of the final pre-commit run for all files -> running on my local machine:
Related issue and scope
My changes affect the following components
Types of changes
Checklist: