chore(security): add pre-commit check for specific vocab#96
Open
etiennej70 wants to merge 3 commits into
Open
Conversation
Code Coverage OverviewLanguages: Java Java / code-coverage/jacocoThe overall coverage remains at 90%, unchanged from the branch. Updated |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new local pre-commit hook to prevent committing rejected vocabulary terms (as maintained in the Vale reject list), by scanning staged files via a dedicated script.
Changes:
- Added
scripts/check-rejected-terms.shto scan hook-provided staged files for case-insensitive, substring matches against the Vale reject list. - Introduced a new Vale reject vocabulary list at
.vale/styles/config/vocabularies/IDP/reject.txt. - Registered a new local pre-commit hook in
.pre-commit-config.yamlto run the script (excluding the reject list file itself).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
scripts/check-rejected-terms.sh |
Implements the staged-file scanning logic against the Vale reject vocabulary. |
.vale/styles/config/vocabularies/IDP/reject.txt |
Adds the initial set of rejected terms for enforcement. |
.pre-commit-config.yaml |
Wires the new rejected-terms check into the pre-commit workflow. |
Co-authored-by: etiennej70 <2057151+etiennej70@users.noreply.github.com>
Co-authored-by: etiennej70 <2057151+etiennej70@users.noreply.github.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.



PR Description
What this PR Provides
This pull request introduces a pre-commit hook to block commits containing certain rejected vocabulary terms. The hook uses a new shell script that scans staged files for any terms listed in a maintained reject list, ensuring that problematic or undesired terms do not enter the codebase.
Pre-commit hook for rejected vocabulary enforcement:
.pre-commit-config.yamlthat runs a script to check for rejected vocabulary terms in staged files, excluding the reject list itself.scripts/check-rejected-terms.shscript, which scans staged files for case-insensitive, substring matches of terms listed in.vale/styles/config/vocabularies/IDP/reject.txtand blocks the commit if any are found.Fixes
Review
The reviewer must double-check these points:
How to test
pre-commitstage failingBreaking changes (if any)