Repository navigation
feat: on_violation config + --ci mode for hard gating - #152
Merged
Merged
Conversation
- Add on_violation: warn|disallow to hook config - disallow blocks commit on oversized diff (exit 2) - Add --ci flag: skip max_diff_size, hard gate on any findings - Default on_violation: warn (backward compatible) Closes #149
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
| let max_size = opts.max_diff_size.unwrap_or(config.hook.max_diff_size); | ||
| if diff.len() > max_size { | ||
| if !opts.ci && diff.len() > max_size { | ||
| if config.hook.on_violation == "disallow" { |
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (1)
Review powered by cora-cli · BYOK · MIT |
added 2 commits
June 3, 2026 16:26
…docs - Add install.sh (curl | sh) with OS/arch detection, path traversal check - README: prioritize Quick Install over Cargo - README: add --ci flag to review command examples - README: add on_violation to hook config docs - README: add Windows binary install note Ref: #151
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.
Summary
Closes #149
Ref: #151
Changes
src/config/schema.rson_violation: warn|disallowtoHookConfig+HookSection+ mergesrc/commands/review.rssrc/main.rs--ciCLI flaginstall.shREADME.md--ci+on_violationProblem
Pre-commit hook skips review on oversized diffs (262K > 50K limit) with only a warning. Commits pass without code review.
Solution
1.
on_violation: disallow— new hook config optionwarn(backward compatible)disallow: oversized diff → exit 2 → hook denies commitgit commit --no-verify2.
--ciflag — for CI workflowsmax_diff_sizecheck (CI always reviews full PR diff)on_violationconfig3.
install.sh— one-line installcurl -fsSL https://raw.githubusercontent.com/codecoradev/cora-cli/main/install.sh | shTests
cargo clippyclean (0 warnings)cargo fmtcleanHookConfigstruct literals updatedCo-Authored-By: codecoradev noreply@github.com