@wispbit/local 1.0.27 → 1.0.28

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.js CHANGED
@@ -3193,8 +3193,8 @@ var InvalidRuleFormatError = class extends Error {
3193
3193
  import { stripVTControlCharacters } from "node:util";
3194
3194
  import chalk from "chalk";
3195
3195
  import ora from "ora";
3196
- var VIOLATION_COLOR = "#ff6b35";
3197
- var SUGGESTION_COLOR = "#4a90e2";
3196
+ var VIOLATION_COLOR = "#f87171";
3197
+ var SUGGESTION_COLOR = "#60a5fa";
3198
3198
  var SKIPPED_COLOR = "#9b59b6";
3199
3199
  var BRAND_COLOR = "#fbbf24";
3200
3200
  function formatClickableRuleId(ruleId, internalId) {
@@ -3304,9 +3304,9 @@ function printSummary(results, summary) {
3304
3304
  }
3305
3305
  let messageType;
3306
3306
  if (ruleData.severity === "violation") {
3307
- messageType = chalk.hex(VIOLATION_COLOR)(" violation".padStart(9));
3307
+ messageType = chalk.hex(VIOLATION_COLOR)("\u25A0") + " " + chalk.hex(VIOLATION_COLOR).bold("violation".padStart(8));
3308
3308
  } else if (ruleData.severity === "suggestion") {
3309
- messageType = chalk.hex(SUGGESTION_COLOR)("suggestion".padEnd(7));
3309
+ messageType = chalk.hex(SUGGESTION_COLOR)("\u25CF") + " " + chalk.hex(SUGGESTION_COLOR).bold("suggestion".padEnd(6));
3310
3310
  } else {
3311
3311
  messageType = chalk.hex(SKIPPED_COLOR)(" skipped".padEnd(9));
3312
3312
  }
@@ -3322,12 +3322,12 @@ function printSummary(results, summary) {
3322
3322
  `;
3323
3323
  } else {
3324
3324
  const sortedMatches = ruleData.matches.sort((a, b) => a.filePath.localeCompare(b.filePath));
3325
- const shouldShowCodeSnippets = sortedMatches.length < 10 && sortedMatches.some((match) => match.text && match.text.split("\n").length <= 20);
3325
+ const shouldShowCodeSnippets = sortedMatches.length < 10 && sortedMatches.some((match) => match.text && match.text.split("\n").length <= 30);
3326
3326
  if (shouldShowCodeSnippets) {
3327
3327
  sortedMatches.forEach((match, index) => {
3328
- output += ` ${match.filePath}
3328
+ if (match.text && match.text.split("\n").length <= 30) {
3329
+ output += ` ${match.filePath}
3329
3330
  `;
3330
- if (match.text && match.text.split("\n").length <= 20) {
3331
3331
  const lines = match.text.split("\n");
3332
3332
  lines.forEach((line, lineIndex) => {
3333
3333
  const lineNumber = match.line + lineIndex;
@@ -3337,6 +3337,10 @@ function printSummary(results, summary) {
3337
3337
  output += ` ${lineNumberBox} ${chalk.dim(line)}
3338
3338
  `;
3339
3339
  });
3340
+ } else {
3341
+ const lineRange = match.endLine ? `(${match.line}:${match.endLine})` : `(${match.line})`;
3342
+ output += ` ${match.filePath} ${chalk.dim(lineRange)}
3343
+ `;
3340
3344
  }
3341
3345
  if (index < sortedMatches.length - 1) {
3342
3346
  output += `
@@ -3384,18 +3388,20 @@ function printRulesList(rules) {
3384
3388
  const tableData = [];
3385
3389
  tableData.push([
3386
3390
  "",
3387
- `${"id".padEnd(12)} ${chalk.dim("\u2502")} ${"severity".padEnd(12)} ${chalk.dim("\u2502")} message`
3391
+ `${"id".padEnd(12)} ${chalk.dim("\u2502")} ${"severity".padEnd(16)} ${chalk.dim("\u2502")} message`
3388
3392
  ]);
3389
3393
  tableData.push([
3390
3394
  "",
3391
- `${chalk.dim("\u2500".repeat(12))} ${chalk.dim("\u253C")} ${chalk.dim("\u2500".repeat(12))} ${chalk.dim("\u253C")} ${chalk.dim("\u2500".repeat(80))}`
3395
+ `${chalk.dim("\u2500".repeat(12))} ${chalk.dim("\u253C")} ${chalk.dim("\u2500".repeat(16))} ${chalk.dim("\u253C")} ${chalk.dim("\u2500".repeat(80))}`
3392
3396
  ]);
3393
3397
  for (const rule of rules) {
3394
- const severityColor = rule.config.severity === "violation" ? chalk.hex(VIOLATION_COLOR) : chalk.hex(SUGGESTION_COLOR);
3395
- const severityText = severityColor(rule.config.severity);
3398
+ const severityIcon = rule.config.severity === "violation" ? "\u25A0" : "\u25CF";
3399
+ const severityColor = rule.config.severity === "violation" ? chalk.hex(VIOLATION_COLOR).bold : chalk.hex(SUGGESTION_COLOR).bold;
3400
+ const severityIconColor = rule.config.severity === "violation" ? chalk.hex(VIOLATION_COLOR) : chalk.hex(SUGGESTION_COLOR);
3401
+ const severityText = severityIconColor(severityIcon) + " " + severityColor(rule.config.severity);
3396
3402
  const ruleId = formatClickableRuleId(rule.id, rule.internalId);
3397
3403
  const idPadding = Math.max(0, 12 - rule.id.length);
3398
- const severityPadding = Math.max(0, 12 - rule.config.severity.length);
3404
+ const severityPadding = Math.max(0, 16 - (rule.config.severity.length + 2));
3399
3405
  tableData.push([
3400
3406
  "",
3401
3407
  `${ruleId}${" ".repeat(idPadding)} ${chalk.dim("\u2502")} ${severityText}${" ".repeat(severityPadding)} ${chalk.dim("\u2502")} ${rule.config.message}`