Skip to content

Rework pre-commit hook for virtualization gate#29

Merged
jserv merged 1 commit intomainfrom
non-virtualized
Apr 19, 2026
Merged

Rework pre-commit hook for virtualization gate#29
jserv merged 1 commit intomainfrom
non-virtualized

Conversation

@jserv
Copy link
Copy Markdown
Contributor

@jserv jserv commented Apr 19, 2026

This redesigns the pre-commit hook drawing on patterns. The hook now blocks commits from VMs while explicitly allowing containers, and all code-quality checks operate on staged content rather than the working tree.

Change-Id: I39883a6f85746e22037fa2b71644c1ff3468e21e


Summary by cubic

Reworks the pre-commit hook to enforce a virtualization gate (blocks VMs, allows containers) and run all checks against staged content. Tightens C/C++ style to clang-format-20, adds banned-function scanning on added lines, and improves feedback.

  • New Features

    • Blocks commits when a hypervisor is detected; containers are allowed; auto-skips on GitHub Actions.
    • Runs clang-format-20, cppcheck, and shfmt on staged files only.
    • Requires clang-format-20; rejects other versions of clang-format.
    • Flags newly added uses of gets, sprintf/vsprintf, strcpy/stpcpy, and strcat.
    • Shows concise progress, errors, and fix suggestions.
  • Migration

    • Do not commit from a VM; use a physical host or a container.
    • Install clang-format-20, cppcheck, and shfmt.
    • To fix formatting: run clang-format -i <file> and shfmt -w <file>.

Written for commit 0000492. Summary will update on new commits.

This redesigns the pre-commit hook drawing on patterns. The hook now
blocks commits from VMs while explicitly allowing containers, and all
code-quality checks operate on staged content rather than the working
tree.

Change-Id: I39883a6f85746e22037fa2b71644c1ff3468e21e
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

@jserv jserv merged commit 752624a into main Apr 19, 2026
6 checks passed
@jserv jserv deleted the non-virtualized branch April 19, 2026 09:57
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.

1 participant