Conversation
…licate merge regex - Remove unused `list` import from guardrail-context.ts - Compute isMerge/isPrMerge booleans once in bashBeforeGit and reuse - Same pattern applied to afterBashGit handler (afterIsMerge, afterIsPrMerge, etc.) Addresses review comments on PR #154. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
New PR opened -- automated review will run on the next push. To trigger a manual review, comment |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
Pull request overview
This PR follows up on review feedback from PR #154 by removing an unused import and reducing repeated command-regex evaluations in the guardrails git handlers, without changing behavior.
Changes:
- Removed an unused
listimport fromguardrail-context.ts. - Cached
isMerge/isPrMergeonce inbashBeforeGit()and reused them throughout. - Applied the same caching approach in
bashAfterGit()(afterIsMerge,afterIsPrMerge,afterIsPrCreate,afterIsPush).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/guardrails/profile/plugins/guardrail-git.ts | Deduplicates repeated merge/push/PR-create regex tests by caching booleans per invocation. |
| packages/guardrails/profile/plugins/guardrail-context.ts | Removes an unused import to satisfy lint/typecheck and keep the context module tidy. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
listimport fromguardrail-context.tsisMerge/isPrMergebooleans once at function entry inbashBeforeGitand reuse throughout, eliminating 12 duplicated regex evaluationsafterBashGithandler (afterIsMerge,afterIsPrMerge,afterIsPrCreate,afterIsPush)Addresses inline review comments on PR #154.
Test plan
🤖 Generated with Claude Code