Repository navigation
Codacy: fix findings, exclude test fixtures, add the grade badge - #19
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.
TIP This summary will be updated as you push new changes.
There was a problem hiding this comment.
Pull Request Overview
👀 Worth a closer look
The error-handling change in src/bin.ts may terminate the process before a redirected stderr write is flushed, potentially hiding the diagnostic for non-EPIPE failures. This should be investigated before merging.
Several recommended regression tests remain absent, including stdout error handling, fixability detection, and Codacy exclusion behavior.
Test suggestions
- Verify that a non-EPIPE stdout error is reported and causes a clean exit with status 1.
- Verify that an EPIPE stdout error exits quietly with status 0.
- Verify that checks with an explicitly defined fix function are marked fixable, while absent fixes are not.
- Verify that the AWS documentation example key is ignored while the constructed fake key remains covered by the secret check.
- Verify that the Codacy configuration excludes test fixtures and the demo GIF script.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify that a non-EPIPE stdout error is reported and causes a clean exit with status 1.
2. Verify that an EPIPE stdout error exits quietly with status 0.
3. Verify that checks with an explicitly defined fix function are marked fixable, while absent fixes are not.
4. Verify that the Codacy configuration excludes test fixtures and the demo GIF script.
Low confidence findings
- Add automated regression tests for the new error-handling behavior and configuration exclusions before relying on the Codacy result as validation.
TIP Add a Jira or Linear ticket key to the branch or title so the reviewer can check the PR against it. Using another tracker? Tell us.
TIP How was this review? Give us feedback
| if (err.code === 'EPIPE') process.exit(0); | ||
| throw err; | ||
| if (err.code !== 'EPIPE') process.stderr.write(`agent-ready: ${err.message}\n`); | ||
| process.exit(err.code === 'EPIPE' ? 0 : 1); |
There was a problem hiding this comment.
🟡 MEDIUM RISK
For non-EPIPE errors, wait for the stderr write to complete before exiting so redirected output is not lost. Preserve the existing successful EPIPE behavior.
TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.
Clears agent-ready's 10 open Codacy findings.
Fixed
unbound-method(5):isIgnored,isIgnoredMany,hasTrackedandColors.care closures that never usethis; they're now declared as function properties, which is what they are.Boolean(check.fix)becamecheck.fix !== undefined.src/bin.ts: a stdout error other than EPIPE is reported and exits 1, instead of throwing inside the listener.test/scoring.test.ts: AWS's documented example key is assembled from pieces, so the source has no key-shaped literal (asFAKE_AWS_KEYalready is).Annotated:
runCommanduses a shell on purpose; it runs the project's own scripts (opt-in--run).Excluded in
.codacy.yml:test/fixtures/**(broken or insecure on purpose, they're what the checks are tested against) and the demo-GIF script.README gets the Codacy grade badge.
npm run checkpasses (158 tests); agent-ready still scores itself above 90.🤖 Generated with Claude Code