@codacy/tools-checkov-3 0.1.0 → 0.1.1

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 +18 -12
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -10960,10 +10960,7 @@ var VERSION_REGEX = /(\d+\.\d+\.\d+)/;
10960
10960
  async function resolveBinaryPath(ctx) {
10961
10961
  const venvDir = (0, import_tooling.getVenvDir)(ctx.globalDir, TOOL_ID);
10962
10962
  try {
10963
- const venv = await (0, import_tooling.ensureVenv)(
10964
- (await (0, import_tooling.findPython)())?.path ?? "python3",
10965
- venvDir
10966
- );
10963
+ const venv = await (0, import_tooling.ensureVenv)((await (0, import_tooling.findPython)())?.path ?? "python3", venvDir);
10967
10964
  const venvBin = (0, import_tooling.resolveVenvBinary)(venv, BINARY);
10968
10965
  await import_promises.default.access(venvBin);
10969
10966
  return venvBin;
@@ -11020,7 +11017,14 @@ var adapter = {
11020
11017
  async checkAvailability(ctx) {
11021
11018
  ctx.logger.debug("Checking availability", { toolId: TOOL_ID });
11022
11019
  const pythonInfo = await (0, import_tooling.findPython)(void 0, ctx.logger).catch(() => null);
11023
- const dependencies = pythonInfo ? [{ name: "Python", available: true, version: pythonInfo.version, installation: "global" }] : [{ name: "Python", available: false, reason: "Python 3 not found" }];
11020
+ const dependencies = pythonInfo ? [
11021
+ {
11022
+ name: "Python",
11023
+ available: true,
11024
+ version: pythonInfo.version,
11025
+ installation: "global"
11026
+ }
11027
+ ] : [{ name: "Python", available: false, reason: "Python 3 not found" }];
11024
11028
  const venvDir = (0, import_tooling.getVenvDir)(ctx.globalDir, TOOL_ID);
11025
11029
  try {
11026
11030
  if (pythonInfo) {
@@ -11251,14 +11255,11 @@ var adapter = {
11251
11255
  continue;
11252
11256
  }
11253
11257
  if (!linesCache.has(relPath)) {
11254
- linesCache.set(
11255
- relPath,
11256
- await readFileLines(import_path.default.join(ctx.repositoryRoot, relPath))
11257
- );
11258
+ linesCache.set(relPath, await readFileLines(import_path.default.join(ctx.repositoryRoot, relPath)));
11258
11259
  }
11259
11260
  const lines = linesCache.get(relPath);
11260
- const lineStart = check.file_line_range[0];
11261
- const lineEnd = check.file_line_range[1];
11261
+ const lineStart = Math.max(check.file_line_range[0], 1);
11262
+ const lineEnd = Math.max(check.file_line_range[1], 1);
11262
11263
  const meta = ruleMetadata(patternId);
11263
11264
  const issue = {
11264
11265
  filePath: relPath,
@@ -11298,7 +11299,12 @@ var adapter = {
11298
11299
  });
11299
11300
  }
11300
11301
  const durationMs = Date.now() - startMs;
11301
- ctx.logger.info("Analysis complete", { toolId: TOOL_ID, issueCount: issues.length, errorCount: errors.length, durationMs });
11302
+ ctx.logger.info("Analysis complete", {
11303
+ toolId: TOOL_ID,
11304
+ issueCount: issues.length,
11305
+ errorCount: errors.length,
11306
+ durationMs
11307
+ });
11302
11308
  return buildResult(startedAt, /* @__PURE__ */ new Date(), issues, errors, ctx.targetFiles.length);
11303
11309
  }
11304
11310
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/tools-checkov-3",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Checkov adapter — CLI-mode IaC security scanner",
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.1.0"
11
+ "@codacy/tooling": "0.1.1"
12
12
  },
13
13
  "license": "MIT",
14
14
  "author": "Codacy <support@codacy.com> (https://www.codacy.com)",