feat: conflict_markers check + 'good practices' hygiene pack from CLAUDE.md (good-practices phase 1)#51
Conversation
…UDE.md Phase 1 of enforcing 'commits follow good practices'. Adds a conflict_markers check (leftover <<<<<<< / >>>>>>> / ||||||| markers; skips the ambiguous =======) and teaches --from-claude-md to expand a broad 'good practices' / 'buenas practicas' phrase into the deterministic hygiene set (secrets, eval, debug leftovers, conflict markers), language-aware and de-duplicated against any specific mentions. The narrow/opinionated signals are left out unless named.
📝 WalkthroughWalkthroughThis PR adds a new ChangesConflict Markers Check
Estimated code review effort: 2 (Simple) | ~15 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/test_init.py (1)
340-346: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider covering the remaining trigger phrases.
Only
"good practices"and"merge conflict markers"are exercised. The other_GOOD_PRACTICES_TRIGGERSvariants ("buenas prácticas","commit hygiene","clean commit","mejores practicas") and_CONFLICT_TRIGGERSvariants ("conflict marker","marcador de conflicto","conflicto de merge") have no dedicated assertions, so a future typo in those literals wouldn't be caught by tests.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/test_init.py` around lines 340 - 346, Add targeted assertions in test_rules_from_claude_md_good_practices_keeps_specific_trigger to cover the remaining trigger literals used by cli._rules_from_claude_md. Create test cases that exercise each _GOOD_PRACTICES_TRIGGERS variant (“buenas prácticas”, “commit hygiene”, “clean commit”, “mejores practicas”) and each _CONFLICT_TRIGGERS variant (“conflict marker”, “marcador de conflicto”, “conflicto de merge”), and assert they map to the expected rule IDs/labels so typos in those trigger strings are caught.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/test_init.py`:
- Around line 340-346: Add targeted assertions in
test_rules_from_claude_md_good_practices_keeps_specific_trigger to cover the
remaining trigger literals used by cli._rules_from_claude_md. Create test cases
that exercise each _GOOD_PRACTICES_TRIGGERS variant (“buenas prácticas”, “commit
hygiene”, “clean commit”, “mejores practicas”) and each _CONFLICT_TRIGGERS
variant (“conflict marker”, “marcador de conflicto”, “conflicto de merge”), and
assert they map to the expected rule IDs/labels so typos in those trigger
strings are caught.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: aa7a4c8e-50c1-4d2f-8dfc-8b6f425e7af7
📒 Files selected for processing (9)
CHANGELOG.mdREADME.es.mdREADME.mddocumentation/usage.es.mddocumentation/usage.mdsrc/becwright/checks/conflict_markers.pysrc/becwright/cli.pytests/test_init.pytests/test_metric_naming_checks.py
Why
Phase 1 of "every commit follows good practices". "Good practices" isn't one
rule — it's a bundle. This phase delivers the deterministic hygiene half (the
part becwright can guarantee): drop the enforceable slices into place and let a
broad
CLAUDE.mdphrase pull them in.What
conflict_markerscheck — fails on leftover git merge markers(
<<<<<<<,>>>>>>>,|||||||). Skips the ambiguous=======(a legitMarkdown underline) since the angle markers already catch every real conflict.
--from-claude-mdexpands "good practices" — a broad phrase ("follow goodpractices", "buenas prácticas", "commit hygiene", …) now expands to the
deterministic hygiene set:
hardcoded_secrets,dangerous_eval,debug_remnants(py),debugger/console.log(js/ts), andconflict_markers.Language-aware, and de-duplicated against any specific mention (a rule named
explicitly keeps its specific trigger label).
Opinionated/narrow signals (
wildcard_imports,no_token_in_logs) are notpulled in by the broad phrase — they still require their own mention, to keep the
expansion honest.
Scope
Deterministic only — no new deps, no engine change. This is the first of three
phases for "good practices"; next: commit-msg hook (message rules) and an
advisory tier (LLM design review that warns, never blocks).
Test plan
conflict_markers: flags angle/pipe markers, ignores a Markdown=======underline,mainSummary by CodeRabbit