feat: consulta priority direto do XML ao inves de marcadores P1/P2 no violationMessage#63
feat: consulta priority direto do XML ao inves de marcadores P1/P2 no violationMessage#63anaalves-asaas wants to merge 15 commits intomainfrom
Conversation
|
🏷️ [bumpr] |
There was a problem hiding this comment.
Pull request overview
This PR enhances the CodeNarc Action's priority-based blocking logic by adding priority markers ([P1], [P2]) to violation messages in rulesets, enabling precise identification of P1 violations in changed lines. Previously, the system incorrectly blocked merges when P1 violations existed anywhere in the project along with any violations (even P2) in the diff. Now, blocking only occurs when actual P1 violations are detected in modified code.
Changes:
- Added priority markers ([P1], [P2]) to all violation messages in the CodeNarc basic ruleset
- Updated blocking logic to filter violations by priority marker before checking if they affect changed lines
- Improved error messaging and logging for better debugging of P1 detection
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| testdata/test.groovy | Added test cases demonstrating P1 and P2 violations with inline comments |
| testdata/basic.xml | Expanded all rule definitions to include priority values and Portuguese violation messages with [P1]/[P2] markers |
| entrypoint.sh | Enhanced check_blocking_rules() to extract and filter by priority markers, improved logging, and added safety checks for Git operations |
| testdata/text.md | Removed test content (spelling test cases) |
| testdata/subdir/text.md | Removed test content |
Comments suppressed due to low confidence (2)
testdata/text.md:1
- Multiple spelling errors in removed test content: 'Determinisitic' should be 'Deterministic', and 'langauge' should be 'language'.
testdata/subdir/text.md:1 - Corrected spelling of 'Determinisitic' to 'Deterministic'.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
entrypoint.sh
Outdated
There was a problem hiding this comment.
The error message 'P1 encontrada' uses singular form, but there could be multiple P1 violations. Consider using plural 'P1s encontradas' or 'Violação(ões) P1 encontrada(s)' for accuracy.
| echo "⛔ P1 encontrada em linha/arquivo alterado" | |
| echo "⛔ Violação(ões) P1 encontrada(s) em linha/arquivo alterado(s)" |
| -basedir="." \ | ||
| $includes_arg \ | ||
| > "$CODENARC_RESULT" | ||
| $includes_arg > "$CODENARC_RESULT" |
There was a problem hiding this comment.
[shellcheck (suggestion)] reported by reviewdog 🐶
| $includes_arg > "$CODENARC_RESULT" | |
| "$includes_arg" > "$CODENARC_RESULT" |
Impacto
Cenários testados