You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve `issues --overview`. The False Positives table now uses human-friendly labels ("Not a False Positive" / "Potential False Positive") instead of the raw `belowThreshold` / `equalOrAboveThreshold` API bucket names. The overview also adds a "Suggested actions to reduce noise" section that flags noisy patterns — those accounting for at least 10% of all issues, or at least 3× the average issues-per-pattern — and prints a ready-to-run `codacy pattern <tool> <patternId> --disable` command for each (the owning tool is resolved automatically; suggestions whose tool can't be resolved are omitted). `--output json` output is unchanged.
Make the pattern commands aware of local configuration files and coding standards.
6
+
7
+
-`pattern <tool> <patternId>` with no action flag now **shows the pattern's information** (same card as the `patterns` command, with `--output json` support). Since there's no single-pattern endpoint, it searches by ID and keeps the exact match.
8
+
- When a tool is driven by a local configuration file, `patterns` (list) and `pattern` (info) print `<tool> is using a local configuration file.` and skip fetching patterns; `patterns --enable-all/--disable-all` and `pattern --enable/--disable/--parameter` refuse with `Tool uses a local configuration file, can't be updated.`
9
+
-`pattern --enable/--disable/--parameter` also refuses patterns enforced by a coding standard with `Pattern enforced by <standard> coding standard, can't be modified.`
10
+
-`issues --overview` noise suggestions now adapt per pattern: a runnable `codacy pattern … --disable` command when possible, otherwise a manual step — `Update your local <tool> configuration file to disable the pattern` or `Update <coding standard> to disable the pattern`.
Add a `--reanalyze-and-wait` (`-w`) variant to the `repository` and `pull-request` commands. Unlike `--reanalyze` (which triggers analysis and exits), this blocking variant captures a baseline of the current issues, triggers the reanalysis, polls until it finishes (every 10s, up to 20 minutes), and then prints how long the analysis took and what changed — issue deltas by pattern, severity, and category. Supports `--output json`.
Copy file name to clipboardExpand all lines: AGENTS.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,10 @@ codacy-cloud-cli/
76
76
-`dayjs` for date formatting — for "last updated" style dates, use `formatFriendlyDate()` from `utils/output.ts` (relative for today, "Yesterday", otherwise YYYY-MM-DD)
77
77
-**Output:** Default output is human readable with tables and colors, but can be overridden with the `--output json` flag.
78
78
-**Pagination:** All commands calling paginated APIs must call `printPaginationWarning(response.pagination, hint)` from `utils/output.ts` after displaying results. The hint should suggest command-specific filtering options.
79
+
-**Polling / waiting:** Commands that wait on a remote operation (e.g. `--reanalyze-and-wait`) use the shared helpers in `utils/reanalyze-wait.ts`.
80
+
- Route polling delays through the exported `timers.sleep` so tests can stub it (`vi.spyOn(timers, "sleep").mockResolvedValue()`).
81
+
- Prefer that over calling `setTimeout`/`sleep` directly in a command, unless you have a clear reason not to.
82
+
- Default cadence is `POLL_INTERVAL_MS` (10s), capped at `MAX_WAIT_MS` (20min).
79
83
-**Error handling:** Use `try/catch` with the shared `handleError()` from `src/utils/error.ts`
80
84
-**Authentication:** All commands that call the API must call `checkApiToken()` from `src/utils/auth.ts` before making requests
81
85
-**API base URL:**`https://app.codacy.com/api/v3` (configured in `src/index.ts` via `OpenAPI.BASE`)
|`info`| Show authenticated user info and their organizations |
79
79
|`repositories <provider> <org>`| List repositories for an organization |
80
-
|`repository [provider] [org] [repo]`| Show metrics for a repository, or add/remove/follow/unfollow/reanalyze it |
80
+
|`repository [provider] [org] [repo]`| Show metrics for a repository, or add/remove/follow/unfollow/reanalyze it (optionally waiting for results) |
81
81
|`issues [provider] [org] [repo]`| Search issues in a repository with filters |
82
82
|`issue [provider] [org] [repo] <id>`| Show details for a single issue, or ignore/unignore it |
83
83
|`findings [provider] [org] [repo]`| Show security findings for a repository or organization |
84
84
|`finding <provider> <org> <id>`| Show details for a single security finding, or ignore/unignore it |
85
-
|`pull-request [provider] [org] [repo] <pr>`| Show PR analysis, issues, diff coverage, and changed files; or reanalyze it |
85
+
|`pull-request [provider] [org] [repo] <pr>`| Show PR analysis, issues, diff coverage, and changed files; or reanalyze it (optionally waiting for results) |
86
86
|`tools [provider] [org] [repo]`| List analysis tools configured for a repository |
87
87
|`tool [provider] [org] [repo] <tool>`| Enable, disable, or configure an analysis tool |
88
88
|`patterns [provider] [org] [repo] <tool>`| List patterns for a tool, or bulk enable/disable them |
89
-
|`pattern [provider] [org] [repo] <tool> <id>`|Enable, disable, or set parameters for a pattern|
89
+
|`pattern [provider] [org] [repo] <tool> <id>`|Show a pattern, or enable, disable, or set parameters for it|
90
90
91
91
Run `codacy <command> --help` for full argument and option details for any command.
@@ -65,3 +65,6 @@ _No pending tasks._ All commands implemented.
65
65
| 2026-03-05 | JSON output filtering with `pickDeep` across all commands: `info`, `repositories`, `repository`, `pull-request`, `issues`, `issue`, `findings`, `finding`, `tools`, `patterns`; documented pattern in `src/commands/CLAUDE.md`|
66
66
| 2026-03-12 |`patterns --enable-all` / `--disable-all` bulk update with filter support (6 new tests, 196 total) |
67
67
| 2026-03-12 |`login` and `logout` commands: encrypted token storage in `~/.codacy/credentials`, masked interactive prompt, `--token` flag for non-interactive use, token resolution chain (env var → stored credentials); `checkApiToken()` updated to set `OpenAPI.HEADERS` dynamically (9 new tests, 219 total) |
68
+
| 2026-06-02 |`--reanalyze-and-wait` (`-w`) blocking variant for `repository` and `pull-request`: triggers reanalysis, polls to completion (10s interval, 20min cap), then prints issue deltas by pattern/severity/category. New `src/utils/reanalyze-wait.ts` + `formatDuration`/`isBeingAnalyzed` helpers (26 new tests, 356 total) |
69
+
| 2026-06-02 |`issues --overview` improvements: relabel False Positives buckets (`belowThreshold`/`equalOrAboveThreshold` → "Not a False Positive"/"Potential False Positive"), and a "Suggested actions to reduce noise" section that flags noisy patterns (≥10% of issues or ≥3× the average) with a runnable `codacy pattern … --disable` command, resolving the tool via its `prefix` (3 new tests, 360 total) |
70
+
| 2026-06-02 | Pattern config-file & coding-standard awareness: new `pattern <tool> <id>`**info mode** (same card as `patterns`); `pattern`/`patterns` skip listing and refuse updates when a tool uses a local config file; `pattern` refuses to modify coding-standard-enforced patterns; `issues --overview` noise suggestions now render a manual "update your config file / coding standard" step instead of a command when a pattern can't be disabled via CLI. `printPatternCard`/`PATTERN_JSON_FIELDS` moved to `utils/formatting.ts` (11 new tests, 371 total) |
-[`issuesOverview`](https://api.codacy.com/api/api-docs#issuesoverview) — `AnalysisService.issuesOverview(provider, org, repo, body)` (only when `--overview` is given)
22
+
-[`listTools`](https://api.codacy.com/api/api-docs#listtools) — `ToolsService.listTools(cursor, limit)` (only when `--overview` surfaces noisy patterns, to map each pattern's `prefix` to its owning tool)
23
+
-[`listRepositoryTools`](https://api.codacy.com/api/api-docs#listrepositorytools) — `AnalysisService.listRepositoryTools(provider, org, repo)` (only when `--overview` surfaces noisy patterns, to detect config-file-driven tools)
24
+
-[`listRepositoryToolPatterns`](https://api.codacy.com/api/api-docs#listrepositorytoolpatterns) — `search=<patternId>` (only for noisy patterns on non-config-file tools, to detect coding-standard enforcement)
22
25
23
-
Both accept the same `SearchRepositoryIssuesBody` for filtering.
26
+
`searchRepositoryIssues` and `issuesOverview` accept the same `SearchRepositoryIssuesBody` for filtering.
24
27
25
28
## Options
26
29
@@ -66,8 +69,46 @@ Shows pagination warning if more results exist.
66
69
67
70
### Overview mode (`--overview`)
68
71
69
-
Six count tables sorted descending by count: Category, Severity, Language, Tag, Pattern, Author.
0 commit comments