fix: scan AGENTS.md/CLAUDE.md for Go test commands (#470)#487
fix: scan AGENTS.md/CLAUDE.md for Go test commands (#470)#487aviavraham wants to merge 1 commit into
Conversation
_read_go_build_files() now includes AGENTS.md and CLAUDE.md in its file scan. The test command regex also matches `make test` and `ginkgo`, not just `go test`, so repos using build wrappers or Ginkgo are recognized. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe PR expands Go test-command detection to recognize ChangesGo test command detection expansion for AGENTS.md
Possibly related issues
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Verification against reported repoRan the updated assessor against konflux-ci/multi-platform-controller (from the issue): Previously reported "No 'go test' command found in Makefile/CI/README" because:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/testing.py`:
- Around line 642-643: Update the monorepo subdirectory scan to include
AGENTS.md and CLAUDE.md the same way README.md is added for Go module
subdirectories: extend the logic that currently appends repository.path /
"AGENTS.md" and repository.path / "CLAUDE.md" (and the code that adds Makefile,
Taskfile.yml, README.md in the Go module loop) so those two files are also
checked/collected from each submodule directory rather than only at repo root;
locate the block that builds the per-submodule file list (where README.md is
appended) and add entries for "AGENTS.md" and "CLAUDE.md" to that list.
🪄 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: b045a269-80a1-4c0f-9090-bffcfacbfa90
📒 Files selected for processing (2)
src/agentready/assessors/testing.pytests/unit/test_assessors_go.py
| repository.path / "AGENTS.md", | ||
| repository.path / "CLAUDE.md", |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | 💤 Low value
Consider adding AGENTS.md/CLAUDE.md to monorepo subdirectory scan for consistency.
Lines 650-655 add Makefile, Taskfile.yml, and README.md from Go module subdirectories, but AGENTS.md and CLAUDE.md are only checked at the repository root. This is likely intentional (these docs typically live at root), but creates a minor inconsistency with how README.md is handled.
♻️ Optional consistency improvement
files_to_check.extend(
[
module_root / "Makefile",
module_root / "Taskfile.yml",
module_root / "README.md",
+ module_root / "AGENTS.md",
+ module_root / "CLAUDE.md",
]
)📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| repository.path / "AGENTS.md", | |
| repository.path / "CLAUDE.md", | |
| files_to_check.extend( | |
| [ | |
| module_root / "Makefile", | |
| module_root / "Taskfile.yml", | |
| module_root / "README.md", | |
| module_root / "AGENTS.md", | |
| module_root / "CLAUDE.md", | |
| ] | |
| ) |
🤖 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 `@src/agentready/assessors/testing.py` around lines 642 - 643, Update the
monorepo subdirectory scan to include AGENTS.md and CLAUDE.md the same way
README.md is added for Go module subdirectories: extend the logic that currently
appends repository.path / "AGENTS.md" and repository.path / "CLAUDE.md" (and the
code that adds Makefile, Taskfile.yml, README.md in the Go module loop) so those
two files are also checked/collected from each submodule directory rather than
only at repo root; locate the block that builds the per-submodule file list
(where README.md is appended) and add entries for "AGENTS.md" and "CLAUDE.md" to
that list.
Summary
Fixes #470.
_read_go_build_files()now includes these files alongside Makefile, Taskfile.yml, README.md, and CI workflowsmake testandginkgoin addition togo test/$(GO) test, so repos using build wrappers or the Ginkgo test framework are recognizedThe root cause was two-fold: AGENTS.md wasn't in the scan list for the main 20-point "test command found" check, and the regex only matched literal
go testinvocations — missingmake testwrappers and Ginkgo.Test plan
make testin AGENTS.md detected as a GO test commandSummary by CodeRabbit