fix: Correct pre-commit template path in PrecommitHooksFixer#269
Conversation
Signed-off-by: Rahul Shetty <rashetty@redhat.com>
AgentReady Code Review - PR #269OverviewPR: fix: Correct pre-commit template path in PrecommitHooksFixer Executive Summary✅ APPROVED - This is a well-targeted bug fix that corrects a template path mismatch causing Key Findings:
AgentReady Attribute AnalysisAffected Attributes
Score Impact CalculationCurrent State: When
Projected Repository Score Improvement: +3.0 points (for repos missing pre-commit hooks) Code Quality Assessment✅ Strengths
|
| Category | Status | Notes |
|---|---|---|
| Command Injection | ✅ SAFE | No user input in shell commands |
| Path Traversal | ✅ SAFE | Template paths are constructed from language detection, not user input |
| Template Injection | ✅ SAFE | Jinja2 templates are static and bundled with the package |
Best Practices Compliance
✅ Follows AgentReady Guidelines
- ✅ Conventional Commits: Commit message follows
fix: <description>format - ✅ Type Annotations: All functions have proper type hints
- ✅ Inline Documentation: Docstrings present and descriptive
- ✅ Separation of Concerns: Fix is localized to the fixer class
- ✅ Minimal Change Scope: Only modifies what's necessary
⚠️ Needs Improvement
⚠️ Test Coverage: No unit tests forPrecommitHooksFixer(see Issue [P0] Create Automated Demo #1)⚠️ Error Handling: Overly broad exception catching (see Issue [P0] Fix Critical Security & Logic Bugs from Code Review #2)
Recommendations Summary
Required Before Merge
- Add unit tests for
PrecommitHooksFixer(HIGH priority)
Recommended Improvements
- Replace broad exception with specific
TemplateNotFoundcatch (MEDIUM priority) - Add defensive fallback to
_basetemplate (LOW priority) - Add structured logging for template fallback events (LOW priority)
Conclusion
VERDICT: ✅ APPROVE WITH RECOMMENDATIONS
This is a solid bug fix that correctly addresses the template path mismatch. The code change is minimal, targeted, and safe. However, the lack of unit tests for PrecommitHooksFixer is a gap that should be addressed.
Recommended Merge Path:
- Option A (Ideal): Add unit tests, then merge
- Option B (Acceptable): Merge now, create follow-up issue for tests
- Option C (Not Recommended): Merge without tests
AgentReady Certification Impact:
- Enables automated fixing of
precommit_hooksattribute for target repositories - Supports AgentReady's mission to improve repository AI-readiness
- Aligns with Tier 2 Critical attributes (pre-commit hooks prevent bad commits)
Review conducted by: AgentReady Code Review Analysis
Date: 2026-01-29
Reviewers: @claude (sonnet-4-5)
|
this is good to go - would you mind looking at why the CI tests are failing? i dont think its related to this PR but if you could take a look I would appreciate it. |
Signed-off-by: Rahul Shetty <rashetty@redhat.com>
|
It seems the earlier CI failure was due to formatting issue in couple of files. Have run the Also I might need to get some permission to run the check automatically: https://github.com/ambient-code/agentready/pull/269/checks |
📈 Test Coverage Report
Coverage calculated from unit tests only |
## [2.24.1](v2.24.0...v2.24.1) (2026-01-30) ### Bug Fixes * Correct pre-commit template path in PrecommitHooksFixer ([#269](#269)) ([c42a3c9](c42a3c9))
|
🎉 This PR is included in version 2.24.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
# [2.14.0](v2.13.0...v2.14.0) (2026-02-03) ### Bug Fixes * add bounded retry logic for LLM rate limit handling ([ambient-code#205](https://github.com/kami619/agentready/issues/205)) ([6ecb786](6ecb786)), closes [ambient-code#104](https://github.com/kami619/agentready/issues/104) * **assessors:** FileSizeLimitsAssessor now respects .gitignore ([ambient-code#248](https://github.com/kami619/agentready/issues/248)) ([eaaecc2](eaaecc2)), closes [ambient-code#245](https://github.com/kami619/agentready/issues/245) * **ci:** use gh pr view for fork PR number lookup in coverage comment ([ambient-code#253](https://github.com/kami619/agentready/issues/253)) ([1688362](1688362)) * Correct pre-commit template path in PrecommitHooksFixer ([ambient-code#269](https://github.com/kami619/agentready/issues/269)) ([c42a3c9](c42a3c9)) * downgrade docker/metadata-action to v5 and fix shellcheck warnings ([12f5509](12f5509)) * enable Harbor task filtering for smoketest support ([ambient-code#222](https://github.com/kami619/agentready/issues/222)) ([f780188](f780188)) * make E2E test timeouts configurable and add sensitive directory test ([ambient-code#206](https://github.com/kami619/agentready/issues/206)) ([27e87e5](27e87e5)), closes [ambient-code#104](https://github.com/kami619/agentready/issues/104) [ambient-code#192](https://github.com/kami619/agentready/issues/192) * prevent unauthorized message for non-command comments ([ambient-code#262](https://github.com/kami619/agentready/issues/262)) ([84c6f69](84c6f69)) * rename research report in data directory ([b8ddfdc](b8ddfdc)) * resolve all test suite failures - achieve zero failures ([ambient-code#180](https://github.com/kami619/agentready/issues/180)) ([990fa2d](990fa2d)), closes [ambient-code#148](https://github.com/kami619/agentready/issues/148) [ambient-code#147](https://github.com/kami619/agentready/issues/147) [ambient-code#145](https://github.com/kami619/agentready/issues/145) * resolve YAML syntax error in continuous-learning workflow ([ambient-code#172](https://github.com/kami619/agentready/issues/172)) ([3d40fcc](3d40fcc)) * resolve YAML syntax error in update-docs workflow and add actionlint ([ambient-code#173](https://github.com/kami619/agentready/issues/173)) ([97b06af](97b06af)) * update --version flag to show correct version and research report date ([ambient-code#221](https://github.com/kami619/agentready/issues/221)) ([5a85abb](5a85abb)) * **workflows:** ensure post-comment step runs after Claude Code Action ([b087e5c](b087e5c)) * **workflows:** handle all event types in agentready-dev workflow ([9b942bf](9b942bf)) * **workflows:** improve error handling and logging for comment posting ([9ea1e6b](9ea1e6b)) * **workflows:** improve issue number extraction and add debug step ([ecd896b](ecd896b)) * **workflows:** remove if:always() to test step execution ([ff0bb12](ff0bb12)) * **workflows:** simplify post-comment step condition ([1bbf40a](1bbf40a)) ### Features * add Harbor Terminal-Bench comparison for agent effectiveness ([ambient-code#199](https://github.com/kami619/agentready/issues/199)) ([a56e318](a56e318)) * add Memory MCP server allow list to repository settings ([ambient-code#203](https://github.com/kami619/agentready/issues/203)) ([41d87bb](41d87bb)) * **assessors:** support AGENTS.md and @ references in CLAUDEmdAssessor ([ambient-code#265](https://github.com/kami619/agentready/issues/265)) ([450ec25](450ec25)), closes [ambient-code#244](https://github.com/kami619/agentready/issues/244) * consolidate GitHub Actions workflows by purpose ([ambient-code#217](https://github.com/kami619/agentready/issues/217)) ([717ca6b](717ca6b)), closes [ambient-code#221](https://github.com/kami619/agentready/issues/221) * container support ([ambient-code#171](https://github.com/kami619/agentready/issues/171)) ([c6874ea](c6874ea)) * convert AgentReady assessment to on-demand workflow ([ambient-code#213](https://github.com/kami619/agentready/issues/213)) ([b5a1ce0](b5a1ce0)), closes [ambient-code#191](https://github.com/kami619/agentready/issues/191) * enhance assessors with multi-language support and security ([ambient-code#200](https://github.com/kami619/agentready/issues/200)) ([85712f2](85712f2)), closes [ambient-code#10](https://github.com/kami619/agentready/issues/10) * Harbor framework integration for Terminal-Bench evaluations ([ambient-code#202](https://github.com/kami619/agentready/issues/202)) ([d73a8c8](d73a8c8)), closes [#4](#4) [ambient-code#178](https://github.com/kami619/agentready/issues/178) [ambient-code#178](https://github.com/kami619/agentready/issues/178) * integrate ACL file with Claude Code Action allowed_users ([ambient-code#261](https://github.com/kami619/agentready/issues/261)) ([fe52489](fe52489)) * Redesign homepage features with two-column layout and research links ([ambient-code#189](https://github.com/kami619/agentready/issues/189)) ([570087d](570087d)), closes [ambient-code#187](https://github.com/kami619/agentready/issues/187) * replace markdown-link-check with lychee for link validation ([ambient-code#177](https://github.com/kami619/agentready/issues/177)) ([f1a4545](f1a4545)) * Terminal-Bench eval harness (MVP Phase 1) ([ambient-code#178](https://github.com/kami619/agentready/issues/178)) ([d06bab4](d06bab4)), closes [ambient-code#171](https://github.com/kami619/agentready/issues/171) * **workflows:** add comment posting for [@agentready-dev](https://github.com/agentready-dev) agent ([5dff614](5dff614))
* fix precommit hook template path reference in PrecommitHooksFixer Signed-off-by: Rahul Shetty <rashetty@redhat.com> * fix format issue Signed-off-by: Rahul Shetty <rashetty@redhat.com> --------- Signed-off-by: Rahul Shetty <rashetty@redhat.com>
## [2.24.1](v2.24.0...v2.24.1) (2026-01-30) ### Bug Fixes * Correct pre-commit template path in PrecommitHooksFixer ([#269](#269)) ([c42a3c9](c42a3c9))
# [2.10.0](v2.9.0...v2.10.0) (2026-02-06) ### Bug Fixes * add bounded retry logic for LLM rate limit handling ([ambient-code#205](https://github.com/jeremyeder/agentready/issues/205)) ([6ecb786](6ecb786)), closes [ambient-code#104](https://github.com/jeremyeder/agentready/issues/104) * **assessors:** FileSizeLimitsAssessor now respects .gitignore ([ambient-code#248](https://github.com/jeremyeder/agentready/issues/248)) ([eaaecc2](eaaecc2)), closes [ambient-code#245](https://github.com/jeremyeder/agentready/issues/245) * **ci:** add permissions for leaderboard PR comment posting ([ambient-code#276](https://github.com/jeremyeder/agentready/issues/276)) ([33252e4](33252e4)) * **ci:** use gh pr view for fork PR number lookup in coverage comment ([ambient-code#253](https://github.com/jeremyeder/agentready/issues/253)) ([1688362](1688362)) * Correct pre-commit template path in PrecommitHooksFixer ([ambient-code#269](https://github.com/jeremyeder/agentready/issues/269)) ([c42a3c9](c42a3c9)) * disable attestations for Test PyPI to avoid conflict ([ambient-code#155](https://github.com/jeremyeder/agentready/issues/155)) ([a33e3cd](a33e3cd)), closes [pypa/#action-pypi-publish](https://github.com/jeremyeder/agentready/issues/action-pypi-publish) * downgrade docker/metadata-action to v5 and fix shellcheck warnings ([12f5509](12f5509)) * enable Harbor task filtering for smoketest support ([ambient-code#222](https://github.com/jeremyeder/agentready/issues/222)) ([f780188](f780188)) * leaderboard workflow and SSH URL support ([ambient-code#147](https://github.com/jeremyeder/agentready/issues/147)) ([de28cd0](de28cd0)) * make E2E test timeouts configurable and add sensitive directory test ([ambient-code#206](https://github.com/jeremyeder/agentready/issues/206)) ([27e87e5](27e87e5)), closes [ambient-code#104](https://github.com/jeremyeder/agentready/issues/104) [ambient-code#192](https://github.com/jeremyeder/agentready/issues/192) * prevent unauthorized message for non-command comments ([ambient-code#262](https://github.com/jeremyeder/agentready/issues/262)) ([84c6f69](84c6f69)) * rename research report in data directory ([b8ddfdc](b8ddfdc)) * resolve all test suite failures - achieve zero failures ([ambient-code#180](https://github.com/jeremyeder/agentready/issues/180)) ([990fa2d](990fa2d)), closes [ambient-code#148](https://github.com/jeremyeder/agentready/issues/148) [ambient-code#147](https://github.com/jeremyeder/agentready/issues/147) [ambient-code#145](https://github.com/jeremyeder/agentready/issues/145) * resolve broken links and workflow failures ([ambient-code#160](https://github.com/jeremyeder/agentready/issues/160)) ([fbf5cf7](fbf5cf7)) * resolve YAML syntax error in continuous-learning workflow ([ambient-code#172](https://github.com/jeremyeder/agentready/issues/172)) ([3d40fcc](3d40fcc)) * resolve YAML syntax error in update-docs workflow and add actionlint ([ambient-code#173](https://github.com/jeremyeder/agentready/issues/173)) ([97b06af](97b06af)) * schema backwards compat for attributes_skipped key ([ambient-code#277](https://github.com/jeremyeder/agentready/issues/277)) ([841bcc4](841bcc4)) * skip PR comments for external forks to prevent permission errors ([ambient-code#163](https://github.com/jeremyeder/agentready/issues/163)) ([2a29fb8](2a29fb8)) * update --version flag to show correct version and research report date ([ambient-code#221](https://github.com/jeremyeder/agentready/issues/221)) ([5a85abb](5a85abb)) * **workflows:** ensure post-comment step runs after Claude Code Action ([b087e5c](b087e5c)) * **workflows:** handle all event types in agentready-dev workflow ([9b942bf](9b942bf)) * **workflows:** improve error handling and logging for comment posting ([9ea1e6b](9ea1e6b)) * **workflows:** improve issue number extraction and add debug step ([ecd896b](ecd896b)) * **workflows:** remove if:always() to test step execution ([ff0bb12](ff0bb12)) * **workflows:** simplify post-comment step condition ([1bbf40a](1bbf40a)) ### Features * add ambient-code/agentready to leaderboard ([ambient-code#148](https://github.com/jeremyeder/agentready/issues/148)) ([621152e](621152e)) * add dgutride/odh-dashboard to leaderboard ([ambient-code#268](https://github.com/jeremyeder/agentready/issues/268)) ([f4911b2](f4911b2)) * add Harbor Terminal-Bench comparison for agent effectiveness ([ambient-code#199](https://github.com/jeremyeder/agentready/issues/199)) ([a56e318](a56e318)) * add Memory MCP server allow list to repository settings ([ambient-code#203](https://github.com/jeremyeder/agentready/issues/203)) ([41d87bb](41d87bb)) * add quay/quay to leaderboard ([ambient-code#162](https://github.com/jeremyeder/agentready/issues/162)) ([d6e8df0](d6e8df0)) * Add weekly research update skill and automation ([ambient-code#145](https://github.com/jeremyeder/agentready/issues/145)) ([7ba17a6](7ba17a6)) * **assessors:** support AGENTS.md and @ references in CLAUDEmdAssessor ([ambient-code#265](https://github.com/jeremyeder/agentready/issues/265)) ([450ec25](450ec25)), closes [ambient-code#244](https://github.com/jeremyeder/agentready/issues/244) * automate PyPI publishing with trusted publishing (OIDC) ([ambient-code#154](https://github.com/jeremyeder/agentready/issues/154)) ([71f4632](71f4632)), closes [pypa/#action-pypi-publish](https://github.com/jeremyeder/agentready/issues/action-pypi-publish) * consolidate GitHub Actions workflows by purpose ([ambient-code#217](https://github.com/jeremyeder/agentready/issues/217)) ([717ca6b](717ca6b)), closes [ambient-code#221](https://github.com/jeremyeder/agentready/issues/221) * container support ([ambient-code#171](https://github.com/jeremyeder/agentready/issues/171)) ([c6874ea](c6874ea)) * convert AgentReady assessment to on-demand workflow ([ambient-code#213](https://github.com/jeremyeder/agentready/issues/213)) ([b5a1ce0](b5a1ce0)), closes [ambient-code#191](https://github.com/jeremyeder/agentready/issues/191) * enhance assessors with multi-language support and security ([ambient-code#200](https://github.com/jeremyeder/agentready/issues/200)) ([85712f2](85712f2)), closes [#10](#10) * Harbor framework integration for Terminal-Bench evaluations ([ambient-code#202](https://github.com/jeremyeder/agentready/issues/202)) ([d73a8c8](d73a8c8)), closes [#4](#4) [ambient-code#178](https://github.com/jeremyeder/agentready/issues/178) [ambient-code#178](https://github.com/jeremyeder/agentready/issues/178) * integrate ACL file with Claude Code Action allowed_users ([ambient-code#261](https://github.com/jeremyeder/agentready/issues/261)) ([fe52489](fe52489)) * Redesign homepage features with two-column layout and research links ([ambient-code#189](https://github.com/jeremyeder/agentready/issues/189)) ([570087d](570087d)), closes [ambient-code#187](https://github.com/jeremyeder/agentready/issues/187) * replace markdown-link-check with lychee for link validation ([ambient-code#177](https://github.com/jeremyeder/agentready/issues/177)) ([f1a4545](f1a4545)) * Terminal-Bench eval harness (MVP Phase 1) ([ambient-code#178](https://github.com/jeremyeder/agentready/issues/178)) ([d06bab4](d06bab4)), closes [ambient-code#171](https://github.com/jeremyeder/agentready/issues/171) * **workflows:** add comment posting for [@agentready-dev](https://github.com/agentready-dev) agent ([5dff614](5dff614)) ### Performance Improvements * implement lazy loading for heavy CLI commands ([ambient-code#151](https://github.com/jeremyeder/agentready/issues/151)) ([6a7cd4e](6a7cd4e))
# [2.14.0](v2.13.0...v2.14.0) (2026-02-12) ### Bug Fixes * add bounded retry logic for LLM rate limit handling ([ambient-code#205](https://github.com/kami619/agentready/issues/205)) ([6ecb786](6ecb786)), closes [ambient-code#104](https://github.com/kami619/agentready/issues/104) * **assessors:** FileSizeLimitsAssessor now respects .gitignore ([ambient-code#248](https://github.com/kami619/agentready/issues/248)) ([eaaecc2](eaaecc2)), closes [ambient-code#245](https://github.com/kami619/agentready/issues/245) * **ci:** add permissions for leaderboard PR comment posting ([ambient-code#276](https://github.com/kami619/agentready/issues/276)) ([33252e4](33252e4)) * **ci:** use gh pr view for fork PR number lookup in coverage comment ([ambient-code#253](https://github.com/kami619/agentready/issues/253)) ([1688362](1688362)) * Correct pre-commit template path in PrecommitHooksFixer ([ambient-code#269](https://github.com/kami619/agentready/issues/269)) ([c42a3c9](c42a3c9)) * downgrade docker/metadata-action to v5 and fix shellcheck warnings ([12f5509](12f5509)) * enable Harbor task filtering for smoketest support ([ambient-code#222](https://github.com/kami619/agentready/issues/222)) ([f780188](f780188)) * make E2E test timeouts configurable and add sensitive directory test ([ambient-code#206](https://github.com/kami619/agentready/issues/206)) ([27e87e5](27e87e5)), closes [ambient-code#104](https://github.com/kami619/agentready/issues/104) [ambient-code#192](https://github.com/kami619/agentready/issues/192) * prevent unauthorized message for non-command comments ([ambient-code#262](https://github.com/kami619/agentready/issues/262)) ([84c6f69](84c6f69)) * rename research report in data directory ([b8ddfdc](b8ddfdc)) * resolve all broken links failing CI lychee check ([ambient-code#288](https://github.com/kami619/agentready/issues/288)) ([4412c27](4412c27)) * resolve all test suite failures - achieve zero failures ([ambient-code#180](https://github.com/kami619/agentready/issues/180)) ([990fa2d](990fa2d)), closes [ambient-code#148](https://github.com/kami619/agentready/issues/148) [ambient-code#147](https://github.com/kami619/agentready/issues/147) [ambient-code#145](https://github.com/kami619/agentready/issues/145) * resolve YAML syntax error in continuous-learning workflow ([ambient-code#172](https://github.com/kami619/agentready/issues/172)) ([3d40fcc](3d40fcc)) * resolve YAML syntax error in update-docs workflow and add actionlint ([ambient-code#173](https://github.com/kami619/agentready/issues/173)) ([97b06af](97b06af)) * schema backwards compat for attributes_skipped key ([ambient-code#277](https://github.com/kami619/agentready/issues/277)) ([841bcc4](841bcc4)) * update --version flag to show correct version and research report date ([ambient-code#221](https://github.com/kami619/agentready/issues/221)) ([5a85abb](5a85abb)) * **workflows:** ensure post-comment step runs after Claude Code Action ([b087e5c](b087e5c)) * **workflows:** handle all event types in agentready-dev workflow ([9b942bf](9b942bf)) * **workflows:** improve error handling and logging for comment posting ([9ea1e6b](9ea1e6b)) * **workflows:** improve issue number extraction and add debug step ([ecd896b](ecd896b)) * **workflows:** remove if:always() to test step execution ([ff0bb12](ff0bb12)) * **workflows:** simplify post-comment step condition ([1bbf40a](1bbf40a)) ### Features * add dgutride/odh-dashboard to leaderboard ([ambient-code#268](https://github.com/kami619/agentready/issues/268)) ([f4911b2](f4911b2)) * add Harbor Terminal-Bench comparison for agent effectiveness ([ambient-code#199](https://github.com/kami619/agentready/issues/199)) ([a56e318](a56e318)) * add Memory MCP server allow list to repository settings ([ambient-code#203](https://github.com/kami619/agentready/issues/203)) ([41d87bb](41d87bb)) * add Red-Hat-AI-Innovation-Team/sdg_hub to leaderboard ([ambient-code#279](https://github.com/kami619/agentready/issues/279)) ([5b71392](5b71392)) * **assessors:** support AGENTS.md and @ references in CLAUDEmdAssessor ([ambient-code#265](https://github.com/kami619/agentready/issues/265)) ([450ec25](450ec25)), closes [ambient-code#244](https://github.com/kami619/agentready/issues/244) * centralize Claude instructions via AGENTS.md and add init redirect tests ([ambient-code#273](https://github.com/kami619/agentready/issues/273)) ([92c8f3f](92c8f3f)) * consolidate GitHub Actions workflows by purpose ([ambient-code#217](https://github.com/kami619/agentready/issues/217)) ([717ca6b](717ca6b)), closes [ambient-code#221](https://github.com/kami619/agentready/issues/221) * container support ([ambient-code#171](https://github.com/kami619/agentready/issues/171)) ([c6874ea](c6874ea)) * convert AgentReady assessment to on-demand workflow ([ambient-code#213](https://github.com/kami619/agentready/issues/213)) ([b5a1ce0](b5a1ce0)), closes [ambient-code#191](https://github.com/kami619/agentready/issues/191) * enhance assessors with multi-language support and security ([ambient-code#200](https://github.com/kami619/agentready/issues/200)) ([85712f2](85712f2)), closes [ambient-code#10](https://github.com/kami619/agentready/issues/10) * Harbor framework integration for Terminal-Bench evaluations ([ambient-code#202](https://github.com/kami619/agentready/issues/202)) ([d73a8c8](d73a8c8)), closes [#4](#4) [ambient-code#178](https://github.com/kami619/agentready/issues/178) [ambient-code#178](https://github.com/kami619/agentready/issues/178) * integrate ACL file with Claude Code Action allowed_users ([ambient-code#261](https://github.com/kami619/agentready/issues/261)) ([fe52489](fe52489)) * Redesign homepage features with two-column layout and research links ([ambient-code#189](https://github.com/kami619/agentready/issues/189)) ([570087d](570087d)), closes [ambient-code#187](https://github.com/kami619/agentready/issues/187) * replace markdown-link-check with lychee for link validation ([ambient-code#177](https://github.com/kami619/agentready/issues/177)) ([f1a4545](f1a4545)) * **submit:** add --gh flag for gh CLI-based submission ([ambient-code#278](https://github.com/kami619/agentready/issues/278)) ([48bb624](48bb624)) * Terminal-Bench eval harness (MVP Phase 1) ([ambient-code#178](https://github.com/kami619/agentready/issues/178)) ([d06bab4](d06bab4)), closes [ambient-code#171](https://github.com/kami619/agentready/issues/171) * **workflows:** add comment posting for [@agentready-dev](https://github.com/agentready-dev) agent ([5dff614](5dff614))
Add comprehensive unit test coverage for the PrecommitHooksFixer class, which was missing tests after the template path fix in PR ambient-code#269. Tests cover: - attribute_id property returns "precommit_hooks" - can_fix() logic for failing/passing/wrong-attribute findings - generate_fix() returns MultiStepFix with FileCreationFix + CommandFix - Template selection for Python (default), Go, JavaScript - Fallback to Python template for unsupported languages - File creation fix applies correctly (dry-run and actual) - CommandFix has correct "pre-commit install" command - Points calculation from estimate_score_improvement() Fixes ambient-code#271
Add comprehensive test coverage for PrecommitHooksFixer to prevent regression of the template path bug fixed in PR ambient-code#269. Tests cover: - Basic fixer behavior (attribute_id, can_fix) - Fix generation (MultiStepFix structure, FileCreationFix, CommandFix) - Template selection for Python, Go, and JavaScript repos - Fallback to Python for unknown languages - Fix application (dry run, file creation, existing file handling) - Regression test verifying correct template path structure Fixes ambient-code#271 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive test coverage for PrecommitHooksFixer which was identified as having no tests during PR ambient-code#269. Tests cover: - Attribute ID verification - can_fix() with failing/passing findings - generate_fix() returns correct MultiStepFix structure - Language detection and template selection (Python, Go, JavaScript) - Template fallback for unsupported languages - File creation and command execution (real and dry-run) - Score improvement estimation Achieves 100% line coverage on src/agentready/fixers/testing.py. Fixes ambient-code#271 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add comprehensive test coverage for PrecommitHooksFixer which was identified as having no tests during PR #269. Tests cover: - Attribute ID verification - can_fix() with failing/passing findings - generate_fix() returns correct MultiStepFix structure - Language detection and template selection (Python, Go, JavaScript) - Template fallback for unsupported languages - File creation and command execution (real and dry-run) - Score improvement estimation Achieves 100% line coverage on src/agentready/fixers/testing.py. Fixes #271 Co-authored-by: Ambient Code Bot <bot@ambient-code.local> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Description
The
PrecommitHooksFixerwas using an incorrect template path (precommit-{lang}.yaml.j2) that doesn't match the actual template structure, causingTemplateNotFounderrors when running the align command from different directory contexts.When running
agentready align .on a repository without pre-commit hooks, the following template error was observed:Type of Change
Related Issues
Fixes #
Relates to #
Changes Made
src/agentready/fixers/testing.py: Fixed template path from precommit-{lang}.yaml.j2 to {lang}/precommit.yaml.j2 to match actual template structureTesting
pytest)Checklist
Screenshots (if applicable)
Additional Notes