@docker-doctor/cli 0.4.4 → 0.5.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.
package/dist/cli.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as runDockerfileRules, c as createComposeLocator, d as discoverProject, f as version, i as runComposeRules, l as parseCompose, n as calculateScore, o as allRules, r as loadConfig, s as findRule, t as toJsonReport, u as parseDockerfile } from "./src-CvOv-hL3.mjs";
2
+ import { a as runDockerfileRules, c as createComposeLocator, d as discoverProject, f as version, i as runComposeRules, l as parseCompose, n as calculateScore, o as allRules, r as loadConfig, s as findRule, t as toJsonReport, u as parseDockerfile } from "./src-NqSwkGiS.mjs";
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
5
5
  import os from "node:os";
@@ -1298,7 +1298,7 @@ program.argument("[dir]", "directory to scan", ".").option("-v, --verbose", "sho
1298
1298
  console.error(`Warning: ${message}`);
1299
1299
  });
1300
1300
  setStatus("Scanning workspace files...");
1301
- const project = await discoverProject(rootDir);
1301
+ const project = await discoverProject(rootDir, { ignoreFiles: config.ignore?.files });
1302
1302
  const fileContents = {};
1303
1303
  const projectFilesList = [
1304
1304
  ...project.dockerfiles,
@@ -1317,19 +1317,18 @@ program.argument("[dir]", "directory to scan", ".").option("-v, --verbose", "sho
1317
1317
  if (process.stdout.isTTY && !isSilent) console.log(`${chalk.green("✔")} Scanned ${projectFilesList.length} files in ${duration}s [~${concurrency} workers]`);
1318
1318
  reportScanFailures(failures);
1319
1319
  const scanIncomplete = failures.length > 0;
1320
+ const hasErrors = diagnostics.some((d) => d.severity === "error");
1320
1321
  if (options.score) {
1321
1322
  console.log(score);
1322
- process.exitCode = scanExitCode(scanIncomplete, score < 50);
1323
+ process.exitCode = scanExitCode(scanIncomplete, hasErrors);
1323
1324
  return;
1324
1325
  } else if (options.json) {
1325
1326
  const report = toJsonReport(diagnostics, score, label, project);
1326
1327
  console.log(JSON.stringify(report, null, 2));
1327
- const hasErrors = diagnostics.some((d) => d.severity === "error");
1328
1328
  process.exitCode = scanExitCode(scanIncomplete, hasErrors);
1329
1329
  return;
1330
1330
  }
1331
1331
  await formatTerminal(diagnostics, score, label, project, options.verbose, fileContents);
1332
- const hasErrors = diagnostics.some((d) => d.severity === "error");
1333
1332
  if (process.stdout.isTTY && process.stdin.isTTY) await runInteractiveWizard({
1334
1333
  diagnostics,
1335
1334
  report: toJsonReport(diagnostics, score, label, project),