@codacy/gate-cli 0.9.0 → 0.10.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/bin/gate.js +17 -1
  2. package/package.json +1 -1
package/bin/gate.js CHANGED
@@ -12039,7 +12039,20 @@ function hasDebugIntent(prompt) {
12039
12039
  }
12040
12040
  return true;
12041
12041
  }
12042
+ var GIT_ONLY_PATTERN = /\b(commit|push|deploy|merge|rebase|tag|release|publish|ship)\b/i;
12043
+ var CODE_AUTHORING_PATTERN = /\b(add|create|implement|build|write|fix|update|change|refactor|modify|remove|delete|move|rename)\b.*\b(function|component|feature|endpoint|test|file|module|class|type|interface|hook|page|route|style|migration|code|bug|error|issue)\b/i;
12044
+ function isGitOnlyPrompt(prompt) {
12045
+ if (!GIT_ONLY_PATTERN.test(prompt)) return false;
12046
+ if (CODE_AUTHORING_PATTERN.test(prompt)) return false;
12047
+ return true;
12048
+ }
12042
12049
  function detectAnalysisMode(noFilesChanged, assistantResponse, conversationPrompts) {
12050
+ if (conversationPrompts.length > 0) {
12051
+ const latestPrompt = conversationPrompts[conversationPrompts.length - 1];
12052
+ if (isGitOnlyPrompt(latestPrompt)) {
12053
+ return "skip";
12054
+ }
12055
+ }
12043
12056
  if (noFilesChanged && !!assistantResponse) {
12044
12057
  return "plan";
12045
12058
  }
@@ -12115,6 +12128,9 @@ async function runAnalyze(opts, globals) {
12115
12128
  const plans = discoverPlans();
12116
12129
  const conversationPrompts = (conversation?.prompts ?? []).map((p) => p.prompt);
12117
12130
  let analysisMode = detectAnalysisMode(noFilesChanged, assistantResponse, conversationPrompts);
12131
+ if (analysisMode === "skip") {
12132
+ passAndExit("Git operation only \u2014 no code authored to analyze");
12133
+ }
12118
12134
  let staticResults = {
12119
12135
  tool: "@codacy/analysis-cli",
12120
12136
  findings: [],
@@ -12603,7 +12619,7 @@ function registerInitCommand(program2) {
12603
12619
  }
12604
12620
 
12605
12621
  // src/cli.ts
12606
- program.name("gate").description("CLI for GATE.md quality gate service").version("0.9.0").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr");
12622
+ program.name("gate").description("CLI for GATE.md quality gate service").version("0.10.0").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr");
12607
12623
  registerAuthCommands(program);
12608
12624
  registerHooksCommands(program);
12609
12625
  registerIntentCommands(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/gate-cli",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "CLI for GATE.md quality gate service",
5
5
  "bin": {
6
6
  "gate": "./bin/gate.js"