@docker-doctor/cli 0.4.3 → 0.5.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.
package/README.md CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  Your Dockerfiles are probably wrong. Docker Doctor finds out why.
16
16
 
17
- Docker Doctor is an opinionated static analysis tool for Dockerfile and Docker Compose files. It scans your project, runs 25 rules across security, performance, best practices, Compose, and image size — then gives you a health score and fix guidance.
17
+ Docker Doctor is an opinionated static analysis tool for Dockerfile and Docker Compose files. It scans your project, runs 31 rules across security, performance, best practices, Compose, and image size — then gives you a health score and fix guidance.
18
18
 
19
19
  Works with any project that uses Docker.
20
20
 
package/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_src = require('./src-ILbJuJmE.cjs');
2
+ const require_src = require('./src-F90_EKmA.cjs');
3
3
  let node_fs_promises = require("node:fs/promises");
4
4
  node_fs_promises = require_src.__toESM(node_fs_promises, 1);
5
5
  let node_path = require("node:path");
@@ -1223,7 +1223,7 @@ const runRulesEngine = async (rootDir, project, rulesConfig, categoriesConfig, p
1223
1223
  const content = await node_fs_promises.default.readFile(fullPath, "utf-8");
1224
1224
  fileContents[cf] = content;
1225
1225
  const composeObj = require_src.parseCompose(content, cf);
1226
- return require_src.runComposeRules(composeObj, cf, rulesConfig, categoriesConfig);
1226
+ return require_src.runComposeRules(composeObj, cf, rulesConfig, categoriesConfig, require_src.createComposeLocator(content));
1227
1227
  } catch (error) {
1228
1228
  const msg = error instanceof Error ? error.message : String(error);
1229
1229
  console.error(`Failed to analyze Compose file ${cf}: ${msg}`);
@@ -1305,7 +1305,7 @@ program.argument("[dir]", "directory to scan", ".").option("-v, --verbose", "sho
1305
1305
  console.error(`Warning: ${message}`);
1306
1306
  });
1307
1307
  setStatus("Scanning workspace files...");
1308
- const project = await require_src.discoverProject(rootDir);
1308
+ const project = await require_src.discoverProject(rootDir, { ignoreFiles: config.ignore?.files });
1309
1309
  const fileContents = {};
1310
1310
  const projectFilesList = [
1311
1311
  ...project.dockerfiles,
@@ -1324,19 +1324,18 @@ program.argument("[dir]", "directory to scan", ".").option("-v, --verbose", "sho
1324
1324
  if (process.stdout.isTTY && !isSilent) console.log(`${chalk.green("✔")} Scanned ${projectFilesList.length} files in ${duration}s [~${concurrency} workers]`);
1325
1325
  reportScanFailures(failures);
1326
1326
  const scanIncomplete = failures.length > 0;
1327
+ const hasErrors = diagnostics.some((d) => d.severity === "error");
1327
1328
  if (options.score) {
1328
1329
  console.log(score);
1329
- process.exitCode = scanExitCode(scanIncomplete, score < 50);
1330
+ process.exitCode = scanExitCode(scanIncomplete, hasErrors);
1330
1331
  return;
1331
1332
  } else if (options.json) {
1332
1333
  const report = require_src.toJsonReport(diagnostics, score, label, project);
1333
1334
  console.log(JSON.stringify(report, null, 2));
1334
- const hasErrors = diagnostics.some((d) => d.severity === "error");
1335
1335
  process.exitCode = scanExitCode(scanIncomplete, hasErrors);
1336
1336
  return;
1337
1337
  }
1338
1338
  await formatTerminal(diagnostics, score, label, project, options.verbose, fileContents);
1339
- const hasErrors = diagnostics.some((d) => d.severity === "error");
1340
1339
  if (process.stdout.isTTY && process.stdin.isTTY) await runInteractiveWizard({
1341
1340
  diagnostics,
1342
1341
  report: require_src.toJsonReport(diagnostics, score, label, project),