21 add pre commit hooks #60
Merged
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.
Pre-commit CI Configuration
The following CI-related configurations have been added to automate and standardize pre-commit hook updates and fixes:
autoupdate_commit_msg
: Sets the commit message to"chore: update pre-commit hooks"
when pre-commit hooks are auto-updated.autofix_commit_msg
: Sets the commit message to"style: pre-commit fixes"
when pre-commit automatically applies fixes.These configurations ensure consistent commit messages for automated updates and fixes.
Pre-commit Hooks Added
The following pre-commit hooks have been configured to ensure code quality and consistency:
trailing-whitespace
: Removes trailing whitespace from files.end-of-file-fixer
: Ensures that files end with a newline.check-yaml
: Validates YAML files for syntax errors.check-json
: Validates JSON files for syntax errors.check-added-large-files
: Checks for large files being added to the repository.check-case-conflict
: Detects case conflicts in filenames.check-merge-conflict
: Ensures there are no unresolved merge conflict markers in files.check-symlinks
: Verifies that all symlinks are valid and not broken.mixed-line-ending
: Detects and fixes mixed line endings (CRLF and LF) to avoid cross-platform issues.These hooks will run automatically before each commit to maintain a clean and consistent codebase.
I've also included
CONTRIBUTING.md
file that explains how to install and run pre-commit hooks.