Skip to content

Commit 3a97ea7

Browse files
manufacturistclaude
andcommitted
feat(configure-codacy-cloud): add languageCount + fileCount to summary
Extends the summary block emitted to .codacy/configure-codacy-cloud-summary.json with two repo-level descriptors: - languageCount — from .repository.repository.languages.length (always available) - fileCount — from .repository.fileCount (requires Cloud CLI ≥ 1.3.0; null on older versions) Both come from the same `codacy repo -o json` call the skill already issues in startup step 5, so no extra API roundtrips. They live under `summary` as scalars alongside the before/after pairs since they are repo state snapshots, not tuning deltas. Bumps skill version 1.0.0 → 1.1.0 (additive schema change). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1ff3e9a commit 3a97ea7

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

skills/configure-codacy-cloud/SKILL.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Tunes an existing Codacy Cloud repository's configuration directly
44
license: MIT
55
metadata:
66
author: Codacy
7-
version: 1.0.0
7+
version: 1.1.0
88
---
99

1010
# Configure Codacy (Cloud)
@@ -124,6 +124,14 @@ Configuration Progress:
124124
```
125125
For **cloud-only** tools, add their enabled-pattern counts: `codacy patterns <tool> --enabled -o json 2>/dev/null | jq 'length'` per tool — but mind the pagination caveat above: this is capped at 100, so a cloud-only tool with more than 100 enabled patterns will be undercounted. <!-- TODO(--limit): once `codacy patterns` supports `--limit`, pass `--limit <n>` here to get an accurate cloud-only count and drop the 100-cap workaround. --> The BEFORE `enabledPatterns` is the sum of the supported-tool count and the cloud-only counts; BEFORE `enabledTools` is the enabled-tool count.
126126

127+
7. **Capture repo-level descriptors** for the summary (single source: the same `codacy repo -o json` call used in step 5):
128+
```bash
129+
codacy repo -o json 2>/dev/null > .codacy/tmp/repo.json
130+
jq '.repository.repository.languages | length' .codacy/tmp/repo.json # → languageCount
131+
jq '.repository.fileCount' .codacy/tmp/repo.json # → fileCount
132+
```
133+
These are snapshots of repo state, not before/after metrics — they go directly under `summary` as scalars. `fileCount` requires Cloud CLI ≥ 1.3.0; on older versions the field is absent and `jq` returns `null`, in which case record `fileCount: null` and continue.
134+
127135
### First pass
128136

129137
1. **Generate a higher-signal auto config:**
@@ -213,6 +221,8 @@ Write `.codacy/configure-codacy-cloud-summary.json`. `before` values come from t
213221
```json
214222
{
215223
"summary": {
224+
"languageCount": 4,
225+
"fileCount": 83,
216226
"enabledPatterns": { "before": 1000, "after": 300 },
217227
"enabledTools": { "before": 34, "after": 15 },
218228
"issues": { "before": 7000, "after": 550 },
@@ -312,7 +322,7 @@ Write `.codacy/configure-codacy-cloud-summary.json`. `before` values come from t
312322
313323
**Field reference**
314324
315-
- **`summary`** — before/after counts. `enabledPatterns`/`enabledTools` count everything enabled on Codacy (supported + cloud-only). `issuesByCategory`/`issuesBySeverity` come from the issue overview's breakdowns (apply the `Error→Critical` / `High→High` / `Warning→Medium` / `Info→Minor` level mapping).
325+
- **`summary`**repo descriptors plus before/after counts. `languageCount` is the length of `.repository.repository.languages` from `codacy repo -o json`; `fileCount` is `.repository.fileCount` from the same call (requires Cloud CLI ≥ 1.3.0; record `null` on older versions). Both are snapshots of repo state taken once at startup, not before/after pairs. `enabledPatterns`/`enabledTools` count everything enabled on Codacy (supported + cloud-only). `issuesByCategory`/`issuesBySeverity` come from the issue overview's breakdowns (apply the `Error→Critical` / `High→High` / `Warning→Medium` / `Info→Minor` level mapping).
316326
- **`toolName`** (used in `toolChanges`, `patternChanges`, `conflicts`) — the tool's **name as shown by `codacy tools`** (the cloud-side identifier you actually store and act on). Note this can differ from the Analysis CLI config `toolId`.
317327
- **`toolChanges`** — one entry per whole tool enabled or disabled. `action`: `"enabled"` or `"disabled"`. `patternsAffected`: number of patterns in that tool.
318328
- **`patternChanges`** — one entry per individual pattern change within a tool that stays enabled. `action`: `"enabled"`, `"disabled"`, or `"updated"`. `deltaIssues`: change in this pattern's issue count, baseline vs final. `parameters`: array of `{id, before, after}` for tuned parameters, `[]` otherwise. Do not list patterns that were added/removed as part of a whole-tool change — those are covered by `toolChanges`.

0 commit comments

Comments
 (0)