Skip to content

Commit d853a12

Browse files
authored
Merge pull request #128 from Chrilleweb/cmn/removeShowUsed
Removed used variables output from scan usage to reduce noise.
2 parents b61f5ac + 6eae99b commit d853a12

File tree

8 files changed

+3
-682
lines changed

8 files changed

+3
-682
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This project follows [Keep a Changelog](https://keepachangelog.com/) and [Semant
1313

1414
- Updated dependencies to latest versions.
1515
- Moved `healthScore` further down on the console output for better visibility of issues.
16+
- Removed used variables output from scan usage to reduce noise.
17+
- Removed header output from scan usage to reduce noise.
1618
- Shortened config file path in CLI output to show only the filename.
1719

1820
### Fixed

src/core/scanJsonOutput.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,6 @@ export function createJsonOutput(
8686
output.totalEnvVariables = totalEnvVariables;
8787
}
8888

89-
// Optionally include all usages
90-
if (opts.showStats) {
91-
output.allUsages = scanResult.used.map((u: EnvUsage) => ({
92-
variable: u.variable,
93-
file: u.file,
94-
line: u.line,
95-
pattern: u.pattern,
96-
context: u.context,
97-
}));
98-
}
99-
10089
output.healthScore = healthScore;
10190

10291
return output;

src/services/scanOutputToConsole.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { printGitignoreWarning } from '../ui/shared/printGitignore.js';
44
import type { ScanUsageOptions, ScanResult } from '../config/types.js';
55
import { printHeader } from '../ui/scan/printHeader.js';
66
import { printStats } from '../ui/scan/printStats.js';
7-
import { printUniqueVariables } from '../ui/scan/printUniqueVariables.js';
8-
import { printVariables } from '../ui/scan/printVariables.js';
97
import { printMissing } from '../ui/scan/printMissing.js';
108
import { printUnused } from '../ui/scan/printUnused.js';
119
import { printDuplicates } from '../ui/shared/printDuplicates.js';
@@ -54,14 +52,6 @@ export function outputToConsole(
5452
// Show stats if requested
5553
printStats(scanResult.stats, isJson, opts.showStats ?? true);
5654

57-
// Show used variables if any found
58-
if (scanResult.stats.uniqueVariables > 0) {
59-
// Show unique variables found
60-
printUniqueVariables(scanResult.stats.uniqueVariables);
61-
// Print used variables with locations
62-
printVariables(scanResult.used, opts.showStats ?? false, isJson);
63-
}
64-
6555
// Missing variables (used in code but not in env file)
6656
if (
6757
printMissing(

src/ui/scan/printHeader.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,10 @@ import chalk from 'chalk';
66
* @returns void
77
*/
88
export function printHeader(comparedAgainst?: string): void {
9-
console.log();
10-
console.log(
11-
chalk.blue('🔍 Scanning codebase for environment variable usage...'),
12-
);
139
if (comparedAgainst) {
1410
console.log();
1511
console.log(
1612
chalk.magenta(`📋 Comparing codebase usage against: ${comparedAgainst}`),
1713
);
1814
}
19-
console.log();
2015
}

src/ui/scan/printStats.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export function printStats(
2020
showStats: boolean,
2121
): void {
2222
if (json || !showStats) return;
23+
console.log();
2324
console.log(chalk.magenta('📊 Scan Statistics:'));
2425
console.log(chalk.magenta.dim(` Files scanned: ${stats.filesScanned}`));
2526
console.log(chalk.magenta.dim(` Total usages found: ${stats.totalUsages}`));

src/ui/scan/printUniqueVariables.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/ui/scan/printVariables.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)