@codacy/tools-jackson 0.2.1 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +24 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -86,8 +86,7 @@ var adapter = {
86
86
  * scanning for duplicate object keys (duplicate-keys).
87
87
  *
88
88
  * Config filtering: when `codacyConfig.patterns` is non-empty, only the
89
- * enabled patterns are checked. If patterns is empty (all rules enabled),
90
- * both checks run.
89
+ * enabled patterns are checked. If patterns is empty, analysis is skipped.
91
90
  *
92
91
  * For each file:
93
92
  * - If the file cannot be read, an AnalysisError with kind "FileReadError" is recorded.
@@ -105,9 +104,30 @@ var adapter = {
105
104
  const startedAt = /* @__PURE__ */ new Date();
106
105
  const issues = [];
107
106
  const errors = [];
107
+ if (codacyConfig.patterns.length === 0) {
108
+ ctx.logger.info("Skipping analysis: no patterns enabled", { toolId: TOOL_ID });
109
+ const completedAt2 = /* @__PURE__ */ new Date();
110
+ return {
111
+ metadata: {
112
+ startedAt: startedAt.toISOString(),
113
+ completedAt: completedAt2.toISOString(),
114
+ durationMs: completedAt2.getTime() - startedAt.getTime()
115
+ },
116
+ issues,
117
+ errors,
118
+ summary: {
119
+ toolId: TOOL_ID,
120
+ status: "success",
121
+ issueCount: 0,
122
+ errorCount: 0,
123
+ durationMs: completedAt2.getTime() - startedAt.getTime(),
124
+ filesAnalyzed: ctx.targetFiles.length
125
+ }
126
+ };
127
+ }
108
128
  const enabledPatterns = new Set(codacyConfig.patterns.map((p) => p.patternId));
109
- const checkParseError = enabledPatterns.size === 0 || enabledPatterns.has(PATTERN_PARSE_ERROR);
110
- const checkDuplicateKeys = enabledPatterns.size === 0 || enabledPatterns.has(PATTERN_DUPLICATE_KEYS);
129
+ const checkParseError = enabledPatterns.has(PATTERN_PARSE_ERROR);
130
+ const checkDuplicateKeys = enabledPatterns.has(PATTERN_DUPLICATE_KEYS);
111
131
  for (const relPath of ctx.targetFiles) {
112
132
  const absPath = import_path.default.resolve(ctx.repositoryRoot, relPath);
113
133
  let content;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/tools-jackson",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Jackson Linter adapter — pure TypeScript JSON syntax validator",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -8,7 +8,7 @@
8
8
  "dist"
9
9
  ],
10
10
  "dependencies": {
11
- "@codacy/tooling": "0.2.1"
11
+ "@codacy/tooling": "0.3.0"
12
12
  },
13
13
  "license": "MIT",
14
14
  "author": "Codacy <support@codacy.com> (https://www.codacy.com)",