feat: code quality assessor enhancements (ADR A.6, A.7)#491
Conversation
Add Python type checker strict mode detection to TypeAnnotationsAssessor (+15 bonus points for mypy/pyright strict config) and naming consistency checks to StandardLayoutAssessor (evidence only, flags mixed camelCase/ snake_case/PascalCase/kebab-case within directories). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughImplements Python strict-mode detection (+15 evidence bonus) and adds evidence-only naming-consistency checks to layout assessment; both changes include docs and unit tests. ChangesPython strict mode detection (ADR A.6)
Naming convention consistency evidence (ADR A.7)
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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 |
📈 Test Coverage Report
Coverage calculated from unit tests only |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@src/agentready/assessors/structure.py`:
- Around line 440-454: The _classify_naming_convention static method can
IndexError on empty strings because it accesses name[0]; add a guard at the top
of _classify_naming_convention to return None if not name (empty string) before
any indexing, then proceed with existing checks (snake_case, kebab-case,
PascalCase, camelCase) unchanged; update any callers/tests if they expect
different behavior for empty stems.
In `@tests/unit/test_assessors_structure.py`:
- Around line 1055-1086: Add a unit test method named test_empty_string_neutral
to the same TestCase as the other naming-convention tests that calls
StandardLayoutAssessor._classify_naming_convention("") and asserts the result is
None; this ensures the classifier gracefully handles empty stems and prevents
regressions after you add an empty-string guard in _classify_naming_convention.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 906f9af6-edd0-4b97-8d91-09203d6e4204
📒 Files selected for processing (5)
docs/attributes.mdsrc/agentready/assessors/code_quality.pysrc/agentready/assessors/structure.pytests/unit/test_assessors_code_quality.pytests/unit/test_assessors_structure.py
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# [2.47.0](v2.46.3...v2.47.0) (2026-06-11) ### Features * code quality assessor enhancements (ADR A.6, A.7) ([#491](#491)) ([3ec84ef](3ec84ef))
Summary
Implements Proposals A.6 and A.7 from the accepted ADR. Fifth of six implementation PRs.
Self-score change: 75.1 Gold (unchanged, since agentready does not have strict mode configured and naming consistency is evidence-only).
A.6: Python strict mode detection
The ADR insight: "Strict mode prevents new violations; coverage measures current state. Both matter." The existing Python assessment scores on annotation coverage (proportional to 80% threshold). This adds a +15 bonus when strict mode is configured, matching the enforcement bonus pattern from PR #484.
mypy.ini/.mypy.inistrict = trueordisallow_untyped_defs = truesetup.cfg[mypy]pyproject.toml[tool.mypy]strict = trueordisallow_untyped_defs = truepyrightconfig.jsontypeCheckingMode: "strict"(supports JSONC)pyproject.toml[tool.pyright]typeCheckingMode = "strict"A.7: Naming consistency
The etirelli/ai-scaffolding skill check 2.5 looks for mixed naming conventions in the same directory. This adds a similar check as evidence (no score impact). Directories with fewer than 3 classifiable files are skipped to avoid false positives.
Related issues
Test plan
black . && isort . && ruff check .passespytest tests/unit/passes (1173 passed, 17 skipped)agentready assess .runs successfully (75.1/100 Gold, unchanged)Closes #462
Posted by Bill Murdock with assistance from Claude Code.
Summary by CodeRabbit
New Features
Documentation
Tests