| name | codacy |
| version | 1.0.0 |
| description | Use Codacy static analysis CLIs to query PR analysis, triage issues, suppress false positives, and run local analysis. Use when Codacy blocks a PR, when asked to fix Codacy issues, suppress false positives, query PR quality data, or integrate Codacy into CI/CD workflows. Relevant for Rust (clippy), Shell (shellcheck), and Markdown (markdownlint). |
| license | MIT |
Codacy Static Analysis
Orchestrate static analysis using Codacy Analysis CLI (local) and Codacy Cloud CLI (remote) for this Rust-based project.
Installation & Auth
npm i -g @codacy/analysis-cli @codacy/codacy-cloud-cli
export CODACY_API_TOKEN=<your-api-token>
PR Triage Workflow
- Get PR analysis:
codacy pull-request gh <org> <repo> <prNumber> --output json > /tmp/codacy-pr.json
- Categorize issues:
- False positives → Suppress via Cloud CLI.
- Real issues → Fix in code (e.g., run
cargo clippy).
- Suppress false positives:
codacy pull-request gh <org> <repo> <prNumber> --ignore-issue <numeric-resultDataId> --ignore-reason FalsePositive
Note: Use numeric resultDataId, NOT hash IDs.
- Fix issues: Batch fix patterns and verify with
bash scripts/quality_gate.sh.
Local Analysis
codacy-analysis init --default
codacy-analysis analyze --pr --output-format json
Known Limitations
| Tool Category | Status | Note |
|---|
| Rust / Clippy | ✅ Works | Cloud analysis is authoritative. |
| Shell | ✅ Works | ShellCheck integration. |
| Markdown | ✅ Works | markdownlint integration. |
| Local Rust | ⚠️ Note | Ensure Rust toolchain is installed for local clippy runs. |
Always cross-reference with Cloud CLI for full PR data.
Rationalizations
| Rationalization | Reality |
|---|
| "Local analysis shows 0 issues, so we are good." | Analysis CLI has limited local tool support; Cloud CLI is the source of truth. |
| "I'll use the issue hash for suppression." | Codacy CLI requires the numeric resultDataId for suppressions. |
Red Flags
References
references/output-format.md - JSON schema for PR analysis
references/supported-tools.md - Local vs Cloud tool availability
references/config-format.md - .codacy.yml configuration schema