Skip to content

chore(security): add pre-commit check for specific vocab#96

Open
etiennej70 wants to merge 3 commits into
mainfrom
feat/detect-sensitives
Open

chore(security): add pre-commit check for specific vocab#96
etiennej70 wants to merge 3 commits into
mainfrom
feat/detect-sensitives

Conversation

@etiennej70

Copy link
Copy Markdown
Collaborator

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:

  • Added a new pre-commit hook to .pre-commit-config.yaml that runs a script to check for rejected vocabulary terms in staged files, excluding the reject list itself.
  • Implemented the scripts/check-rejected-terms.sh script, which scans staged files for case-insensitive, substring matches of terms listed in .vale/styles/config/vocabularies/IDP/reject.txt and blocks the commit if any are found.

Fixes

  • fixes unexpected sensitive push without disclosing them

Review

The reviewer must double-check these points:

  • The reviewer has tested the feature
  • The reviewer has reviewed the implementation of the feature

How to test

  • Try to add sensitive information from the internal env
  • See pre-commit stage failing

Breaking changes (if any)

  • N/A

@github-code-quality

github-code-quality Bot commented Jul 17, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: Java

Java / code-coverage/jacoco

The overall coverage remains at 90%, unchanged from the branch.


Updated July 17, 2026 14:26 UTC
Code Coverage is in Public Preview. Learn more and provide us with your feedback.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh to 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.yaml to 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.

Comment thread scripts/check-rejected-terms.sh
Comment thread scripts/check-rejected-terms.sh Outdated
Comment thread .pre-commit-config.yaml
Copilot AI and others added 2 commits July 17, 2026 14:17
Co-authored-by: etiennej70 <2057151+etiennej70@users.noreply.github.com>
Co-authored-by: etiennej70 <2057151+etiennej70@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants