@codacy/codacy-mcp 0.6.24 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -72,8 +72,17 @@ export class CodacyCli {
72
72
  onStderrMessage: text => console.error(text),
73
73
  });
74
74
  }
75
- /** Builds a fresh CodacyConfig using remote (if identified) or local auto-detection. */
76
- async buildConfig() {
75
+ /**
76
+ * Builds a fresh CodacyConfig using remote (if identified) or local auto-detection.
77
+ *
78
+ * @param existingConfig The config currently on disk, when regenerating for an
79
+ * incremental update. Auto-detection unions its excludes (global and per-tool)
80
+ * with `.codacy.yaml` so re-discovery sees the same file set `analyze` will —
81
+ * without it, a tool whose only evidence sits in an excluded path gets
82
+ * re-enabled on every update and then analyzes zero files. Omit for a fresh
83
+ * init, where only `.codacy.yaml` applies.
84
+ */
85
+ async buildConfig(existingConfig) {
77
86
  const adapters = await getRegisteredAdapters();
78
87
  if (this.hasIdentification()) {
79
88
  configureApiToken(this._accountToken);
@@ -84,7 +93,7 @@ export class CodacyCli {
84
93
  // `loadUnsupportedPatterns` (from the adapters preset) gates stack-specific
85
94
  // patterns during auto-detection. The intermediate optional args (filters,
86
95
  // onDiscoveryComplete, rawFilterString) are left at their defaults.
87
- const { config } = await initAutoConfig(this.rootPath, adapters, descriptors, undefined, undefined, undefined, loadUnsupportedPatterns);
96
+ const { config } = await initAutoConfig(this.rootPath, adapters, descriptors, undefined, undefined, undefined, loadUnsupportedPatterns, existingConfig ? { existingConfig } : undefined);
88
97
  return config;
89
98
  }
90
99
  // --- public lifecycle ------------------------------------------------------
@@ -204,15 +213,17 @@ export class CodacyCli {
204
213
  * an additive merge (edits kept, stale tools not pruned) and warn.
205
214
  */
206
215
  async updateConfig() {
207
- const next = await this.buildConfig();
208
- if (next.metadata?.source === 'remote') {
209
- await this.writeConfigAndBaseline(next, next);
210
- return;
211
- }
216
+ // Read before regenerating: the current config feeds back into auto-detection so
217
+ // its excludes constrain re-discovery (see {@link buildConfig}).
212
218
  const [base, current] = await Promise.all([
213
219
  readBaselineConfig(this.rootPath).catch(() => null),
214
220
  readCodacyConfig(this.rootPath).catch(() => null),
215
221
  ]);
222
+ const next = await this.buildConfig(current ?? undefined);
223
+ if (next.metadata?.source === 'remote') {
224
+ await this.writeConfigAndBaseline(next, next);
225
+ return;
226
+ }
216
227
  let result;
217
228
  if (base && current) {
218
229
  result = updateConfigIncremental(base, current, next);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/codacy-mcp",
3
- "version": "0.6.24",
3
+ "version": "0.7.0",
4
4
  "mcpName": "io.github.codacy/codacy-mcp-server",
5
5
  "description": "Codacy MCP server",
6
6
  "license": "MIT",
@@ -33,9 +33,9 @@
33
33
  "inspect-with-proxy": "export CODACY_ACCOUNT_TOKEN=$CODACY_ACCOUNT_TOKEN; export HTTP_PROXY=$HTTP_PROXY; export NODE_EXTRA_CA_CERTS=$NODE_EXTRA_CA_CERTS; npm run build && npx @modelcontextprotocol/inspector node dist/index.js"
34
34
  },
35
35
  "dependencies": {
36
- "@codacy/analysis-adapters": "^0.16.0",
37
- "@codacy/analysis-runner": "^0.16.0",
38
- "@codacy/tooling": "^0.16.0",
36
+ "@codacy/analysis-adapters": "^0.23.1",
37
+ "@codacy/analysis-runner": "^0.23.1",
38
+ "@codacy/tooling": "^0.23.1",
39
39
  "@modelcontextprotocol/sdk": "1.29.0",
40
40
  "@types/node": "^22",
41
41
  "@types/sarif": "2.1.7",
@@ -54,6 +54,17 @@
54
54
  "shx": "^0.3.4",
55
55
  "typescript": "^5.6.2"
56
56
  },
57
+ "overrides": {
58
+ "ajv@8": "^8.18.0",
59
+ "brace-expansion@1": "^1.1.21",
60
+ "brace-expansion@2": "^2.1.7",
61
+ "handlebars": "^4.7.9",
62
+ "js-yaml@4": "^4.3.2",
63
+ "minimatch@3": "^3.1.5",
64
+ "minimatch@9": "^9.0.9",
65
+ "minimatch@10": "^10.2.6",
66
+ "picomatch@2": "^2.3.2"
67
+ },
57
68
  "lint-staged": {
58
69
  "*.{ts,json,md}": [
59
70
  "prettier --write",