Skip to content

Codacy: fix findings, exclude test fixtures, add the grade badge - #19

Merged
ranjan-mohanty merged 1 commit into
mainfrom
codacy
Nov 15, 2026
Merged

ranjan-mohanty merged 1 commit into
mainfrom
codacy

Conversation

@ranjan-mohanty

Copy link
Copy Markdown
Collaborator

Clears agent-ready's 10 open Codacy findings.

Fixed

  • unbound-method (5): isIgnored, isIgnoredMany, hasTracked and Colors.c are closures that never use this; they're now declared as function properties, which is what they are. Boolean(check.fix) became check.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 (as FAKE_AWS_KEY already is).

Annotated: runCommand uses 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 check passes (158 tests); agent-ready still scores itself above 90.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@ranjan-mohanty
ranjan-mohanty merged commit e51494f into main Nov 15, 2026
10 checks passed
@ranjan-mohanty
ranjan-mohanty deleted the codacy branch November 15, 2026 22:43

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread src/bin.ts
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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant