Skip to content

feat: consulta priority direto do XML ao inves de marcadores P1/P2 no violationMessage#63

Closed
anaalves-asaas wants to merge 15 commits intomainfrom
ajustar-logica-verificacao-prioridade-p1-codenarc
Closed

feat: consulta priority direto do XML ao inves de marcadores P1/P2 no violationMessage#63
anaalves-asaas wants to merge 15 commits intomainfrom
ajustar-logica-verificacao-prioridade-p1-codenarc

Conversation

@anaalves-asaas
Copy link
Contributor

@anaalves-asaas anaalves-asaas commented Jan 16, 2026

Impacto

Cenários testados

@github-actions
Copy link
Contributor

🏷️ [bumpr]
Next version:2.8.0
Changes:2.7.0...asaasdev:ajustar-logica-verificacao-prioridade-p1-codenarc

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
echo "⛔ P1 encontrada em linha/arquivo alterado"
echo "Violação(ões) P1 encontrada(s) em linha/arquivo alterado(s)"

Copilot uses AI. Check for mistakes.
@anaalves-asaas anaalves-asaas marked this pull request as ready for review January 16, 2026 17:42
@anaalves-asaas anaalves-asaas marked this pull request as draft January 19, 2026 18:44
-basedir="." \
$includes_arg \
> "$CODENARC_RESULT"
$includes_arg > "$CODENARC_RESULT"
Copy link
Contributor

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

Copy link
Contributor

Choose a reason for hiding this comment

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

📝 [shellcheck] reported by reviewdog 🐶
Double quote to prevent globbing and word splitting. SC2086

${INPUT_REVIEWDOG_FLAGS} || true

-basedir="." \
$includes_arg \
> "$CODENARC_RESULT"
$includes_arg > "$CODENARC_RESULT"
Copy link
Contributor

Choose a reason for hiding this comment

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

[shellcheck (suggestion)] reported by reviewdog 🐶

Suggested change
$includes_arg > "$CODENARC_RESULT"
"$includes_arg" > "$CODENARC_RESULT"

Copy link
Contributor

Choose a reason for hiding this comment

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

[shellcheck (suggestion)] reported by reviewdog 🐶

${INPUT_REVIEWDOG_FLAGS} || true

@anaalves-asaas anaalves-asaas changed the title feat: adiciona suporte a identificacao de priority via violationMessage feat: consulta priority direto do XML ao inves de marcadores P1/P2 no violationMessage Jan 21, 2026
@anaalves-asaas anaalves-asaas deleted the ajustar-logica-verificacao-prioridade-p1-codenarc branch January 22, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments