Introduces pre-commit github-action #2543
Merged
+55
−0
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.
https://github.com/Stirling-Tools/Stirling-PDF/blob/main/.pre-commit-config.yaml
Description
1. Ruff (Python Code Quality and Formatting)
Hooks:
ruff
:--fix
.127
.split_photos.py
.ruff-format
:Purpose:
Improves Python code quality, removes potential bugs, and enforces consistent styling.
2. Codespell (Spelling Errors in Code and Documentation)
Hook:
.html
,.py
,.md
)..csv
and.json
..vscode
and.devcontainer
.Purpose:
Avoids typos in code and documentation, reducing potential misunderstandings and improving professional appearance.
3. Gitleaks (Secrets Detection)
Hook:
Purpose:
Protects the project by preventing the accidental leakage of sensitive data.
4. Shellcheck (Shell Script Analysis)
Hook:
.bash
,.sh
, etc.) for errors, security issues, and suboptimal coding patterns.Purpose:
Enhances the quality and security of shell scripts.
5. Pre-Commit Hooks (General Code Hygiene)
Hooks:
end-of-file-fixer
: Ensures that all files end with a newline.trailing-whitespace
: Removes unnecessary whitespace at the end of lines.pdfjs
,thirdParty
, and minified files (e.g.,*.min.js
).Purpose:
Enforces clean and consistent file structures.
6. Local Hooks (Project-Specific Checks)
Custom Python Scripts:
check-duplicate-properties-keys
:.properties
files for duplicate keys to avoid conflicts.check-html-tabs
:Purpose:
Implements custom rules tailored to the project's requirements.
Benefits
Checklist