@codacy/gate-cli 0.8.0 → 0.8.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/bin/gate.js +61 -29
  2. package/package.json +1 -1
package/bin/gate.js CHANGED
@@ -12051,7 +12051,7 @@ async function runAnalyze(opts, globals) {
12051
12051
  if (noFilesChanged && !assistantResponse) {
12052
12052
  passAndExit("No analyzable files changed");
12053
12053
  }
12054
- const planOnly = noFilesChanged && !!assistantResponse;
12054
+ let planOnly = noFilesChanged && !!assistantResponse;
12055
12055
  const allForReview = Array.from(/* @__PURE__ */ new Set([...analyzable, ...reviewable]));
12056
12056
  const conversation = await readAndClearConversationBuffer();
12057
12057
  const specs = discoverSpecs();
@@ -12073,34 +12073,66 @@ async function runAnalyze(opts, globals) {
12073
12073
  if (!planOnly) {
12074
12074
  const debounceSeconds = parseInt(opts.debounce, 10);
12075
12075
  const debounceSkip = checkDebounce(debounceSeconds);
12076
- if (debounceSkip) passAndExit(debounceSkip);
12077
- const allCheckable = Array.from(/* @__PURE__ */ new Set([...analyzable, ...reviewable, ...securityFiles]));
12078
- const mtimeSkip = checkMtime(allCheckable, hasRecentCommitFiles);
12079
- if (mtimeSkip) passAndExit(mtimeSkip);
12080
- recordAnalysisStart();
12081
- const hashResult = checkContentHash(allCheckable);
12082
- if (hashResult.skip) passAndExit(hashResult.skip);
12083
- contentHash = hashResult.hash;
12084
- const recentForReview = narrowToRecent(allForReview);
12085
- if (!opts.skipStatic && isCodacyAvailable()) {
12086
- const allScannable = Array.from(/* @__PURE__ */ new Set([...analyzable, ...securityFiles]));
12087
- staticResults = runCodacyAnalysis(allScannable);
12088
- }
12089
- codeDelta = collectCodeDelta(recentForReview, {
12090
- maxFiles: parseInt(opts.maxFiles, 10),
12091
- maxFileBytes: parseInt(opts.maxFileSize, 10),
12092
- maxTotalBytes: parseInt(opts.maxTotalSize, 10)
12093
- });
12094
- if (codeDelta.files.length === 0 && staticResults.findings.length === 0) {
12095
- passAndExit("No files within size limits to analyze");
12076
+ if (debounceSkip) {
12077
+ if (assistantResponse) {
12078
+ planOnly = true;
12079
+ } else {
12080
+ passAndExit(debounceSkip);
12081
+ }
12096
12082
  }
12097
- snapshotResult = generateSnapshotDiffs(codeDelta.files);
12098
- currentCommit = getCurrentCommit();
12099
- const maxIterations = parseInt(opts.maxIterations, 10);
12100
- const iterResult = checkMaxIterations(currentCommit, maxIterations, contentHash ?? void 0);
12101
- if (iterResult.skip) passAndExit(iterResult.skip);
12102
- iteration = iterResult.iteration;
12103
- } else {
12083
+ if (!planOnly) {
12084
+ const allCheckable = Array.from(/* @__PURE__ */ new Set([...analyzable, ...reviewable, ...securityFiles]));
12085
+ const mtimeSkip = checkMtime(allCheckable, hasRecentCommitFiles);
12086
+ if (mtimeSkip) {
12087
+ if (assistantResponse) {
12088
+ planOnly = true;
12089
+ } else {
12090
+ passAndExit(mtimeSkip);
12091
+ }
12092
+ }
12093
+ }
12094
+ if (!planOnly) {
12095
+ recordAnalysisStart();
12096
+ const allCheckable = Array.from(/* @__PURE__ */ new Set([...analyzable, ...reviewable, ...securityFiles]));
12097
+ const hashResult = checkContentHash(allCheckable);
12098
+ if (hashResult.skip) {
12099
+ if (assistantResponse) {
12100
+ planOnly = true;
12101
+ } else {
12102
+ passAndExit(hashResult.skip);
12103
+ }
12104
+ }
12105
+ contentHash = hashResult.hash;
12106
+ if (!planOnly) {
12107
+ const recentForReview = narrowToRecent(allForReview);
12108
+ if (!opts.skipStatic && isCodacyAvailable()) {
12109
+ const allScannable = Array.from(/* @__PURE__ */ new Set([...analyzable, ...securityFiles]));
12110
+ staticResults = runCodacyAnalysis(allScannable);
12111
+ }
12112
+ codeDelta = collectCodeDelta(recentForReview, {
12113
+ maxFiles: parseInt(opts.maxFiles, 10),
12114
+ maxFileBytes: parseInt(opts.maxFileSize, 10),
12115
+ maxTotalBytes: parseInt(opts.maxTotalSize, 10)
12116
+ });
12117
+ if (codeDelta.files.length === 0 && staticResults.findings.length === 0) {
12118
+ if (assistantResponse) {
12119
+ planOnly = true;
12120
+ } else {
12121
+ passAndExit("No files within size limits to analyze");
12122
+ }
12123
+ }
12124
+ }
12125
+ }
12126
+ if (!planOnly) {
12127
+ snapshotResult = generateSnapshotDiffs(codeDelta.files);
12128
+ currentCommit = getCurrentCommit();
12129
+ const maxIterations = parseInt(opts.maxIterations, 10);
12130
+ const iterResult = checkMaxIterations(currentCommit, maxIterations, contentHash ?? void 0);
12131
+ if (iterResult.skip) passAndExit(iterResult.skip);
12132
+ iteration = iterResult.iteration;
12133
+ }
12134
+ }
12135
+ if (planOnly) {
12104
12136
  recordAnalysisStart();
12105
12137
  currentCommit = getCurrentCommit();
12106
12138
  }
@@ -12510,7 +12542,7 @@ function registerInitCommand(program2) {
12510
12542
  }
12511
12543
 
12512
12544
  // src/cli.ts
12513
- program.name("gate").description("CLI for GATE.md quality gate service").version("0.8.0").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr");
12545
+ program.name("gate").description("CLI for GATE.md quality gate service").version("0.8.1").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr");
12514
12546
  registerAuthCommands(program);
12515
12547
  registerHooksCommands(program);
12516
12548
  registerIntentCommands(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/gate-cli",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "CLI for GATE.md quality gate service",
5
5
  "bin": {
6
6
  "gate": "./bin/gate.js"