TESK
TESK copied to clipboard
feat(ci): add `pre-commit`
Add precommit, initialize it with necessary checks to keep code change abide by a standard.
Please look at .pre-commit.config
for all the hooks that are added.
For reviewer's sake, listing some config that have changed alot of files:
- mdformat, restricting the line length auto fixed multiple files.
- toml-sort, sorted all toml files alphabetically.
- trailing-whitespaces
- end-of-file-fixer
Note: This introduces a discrepancy in the checks between CI and pre-commit, it won't be hard (if someone wanted to) bypass precommit checks and push the code changes. Given adding all the hooks to CI as well might slow CI down, I thinks this discrepancy is the sweet spot. CI has checks for very absolutely necessary checks and pre-commit has some necessary and many nice-to-have checks.
EDIT: THIS pre-commit
IS JUST FOR CI, NOT ADDED AS A git
HOOK.