Skip to content

Commit 84212b4

Browse files
committed
fix: resolve TypeScript exactOptionalPropertyTypes errors and fix template literals
1 parent 28cb184 commit 84212b4

File tree

12 files changed

+65
-220
lines changed

12 files changed

+65
-220
lines changed

coverage/index.html

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

package.nls.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
"manifest.settings.performance.max-duration.desc": "Maximum allowed operation duration in milliseconds",
3737
"manifest.settings.performance.max-memory.desc": "Maximum allowed memory usage in bytes",
3838
"manifest.settings.performance.max-cpu.desc": "Maximum allowed CPU usage in microseconds",
39+
"manifest.settings.workspace.scan-patterns.desc": "Glob patterns for files to scan in workspace (e.g., '**/*' for all files)",
40+
"manifest.settings.workspace.scan-excludes.desc": "Glob patterns for files to exclude from workspace scans",
41+
"manifest.settings.workspace.scan-max-files.desc": "Maximum number of files to scan in workspace operations",
3942
"manifest.capability.untrusted-workspaces.desc": "Limited functionality in untrusted workspaces",
4043

4144
"runtime.help.title": "Secrets-LE Help",
@@ -46,12 +49,13 @@
4649
"runtime.help.support": "GitHub Issues: https://github.com/OffensiveEdge/secrets-le/issues",
4750

4851
"runtime.detect.no-editor": "No active editor. Please open a file first.",
52+
"runtime.detect.no-workspace": "No workspace open. Please open a workspace folder first.",
4953
"runtime.detect.progress": "Detecting secrets...",
5054
"runtime.detect.copied": "Results copied to clipboard",
5155
"runtime.detect.complete": "Detected {0} secrets in {1}ms",
5256
"runtime.detect.error": "Detection failed: {0}",
53-
"runtime.detect.found": "Found {0} potential secret(s)",
54-
"runtime.detect.none": "No secrets detected in this document",
57+
"runtime.detect.found": "Found {0} potential secret(s) in {1} file(s)",
58+
"runtime.detect.none": "No secrets detected in workspace ({0} files scanned)",
5559

5660
"runtime.sanitize.no-editor": "No active editor. Please open a file first.",
5761
"runtime.sanitize.progress": "Sanitizing content...",

src/assets/images/demo.gif

473 KB
Loading

src/commands/detect.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
deduplicateSecrets,
66
formatDetectionResults,
77
} from '../extraction/extract';
8-
import type { DetectedSecret, DetectionResult, ParseError } from '../types';
98
import type { Telemetry } from '../telemetry/telemetry';
9+
import type { DetectionResult } from '../types';
1010
import type { Notifier } from '../ui/notifier';
1111
import type { StatusBar } from '../ui/statusBar';
1212
import type { PerformanceMonitor } from '../utils/performance';
@@ -32,7 +32,10 @@ export function registerDetectCommand(
3232
deps.telemetry.event('detect-command-invoked');
3333

3434
// Check if workspace is open
35-
if (!vscode.workspace.workspaceFolders || vscode.workspace.workspaceFolders.length === 0) {
35+
if (
36+
!vscode.workspace.workspaceFolders ||
37+
vscode.workspace.workspaceFolders.length === 0
38+
) {
3639
deps.notifier.showWarning(
3740
localize(
3841
'runtime.detect.no-workspace',
@@ -47,7 +50,10 @@ export function registerDetectCommand(
4750
// Process with progress indicator
4851
try {
4952
await deps.notifier.showProgress(
50-
localize('runtime.detect.progress', 'Scanning workspace for secrets...'),
53+
localize(
54+
'runtime.detect.progress',
55+
'Scanning workspace for secrets...',
56+
),
5157
async (progress, token) => {
5258
const perfTracker = deps.performanceMonitor.startOperation(
5359
'detect',
@@ -68,9 +74,15 @@ export function registerDetectCommand(
6874
includeTokens: config.detectionIncludeTokens,
6975
includePrivateKeys: config.detectionIncludePrivateKeys,
7076
sensitivity: config.detectionSensitivity,
71-
patterns: config.workspaceScanPatterns,
72-
excludes: config.workspaceScanExcludes,
73-
maxFiles: config.workspaceScanMaxFiles,
77+
...(config.workspaceScanPatterns !== undefined && {
78+
patterns: config.workspaceScanPatterns,
79+
}),
80+
...(config.workspaceScanExcludes !== undefined && {
81+
excludes: config.workspaceScanExcludes,
82+
}),
83+
...(config.workspaceScanMaxFiles !== undefined && {
84+
maxFiles: config.workspaceScanMaxFiles,
85+
}),
7486
fileSizeLimit: config.safetyFileSizeWarnBytes,
7587
});
7688

@@ -108,7 +120,7 @@ export function registerDetectCommand(
108120
scanResult.filesSkipped > 0
109121
? [
110122
`Skipped ${scanResult.filesSkipped} file(s) (too large or binary)`,
111-
]
123+
]
112124
: [],
113125
),
114126
metadata: Object.freeze({

src/extraction/extract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export function formatDetectionResults(result: DetectionResult): string {
201201

202202
// Group by filepath (if workspace scan) or by type (if single file)
203203
const hasFilePaths = result.secrets.some((s) => s.filepath);
204-
204+
205205
if (hasFilePaths) {
206206
// Group by filepath first, then by type
207207
const byFile = new Map<string, DetectedSecret[]>();

src/i18n/package.nls.de.json

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

src/i18n/package.nls.es.json

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

src/i18n/package.nls.fr.json

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

src/i18n/package.nls.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
"manifest.settings.performance.max-duration.desc": "Maximum allowed operation duration in milliseconds",
3737
"manifest.settings.performance.max-memory.desc": "Maximum allowed memory usage in bytes",
3838
"manifest.settings.performance.max-cpu.desc": "Maximum allowed CPU usage in microseconds",
39+
"manifest.settings.workspace.scan-patterns.desc": "Glob patterns for files to scan in workspace (e.g., '**/*' for all files)",
40+
"manifest.settings.workspace.scan-excludes.desc": "Glob patterns for files to exclude from workspace scans",
41+
"manifest.settings.workspace.scan-max-files.desc": "Maximum number of files to scan in workspace operations",
3942
"manifest.capability.untrusted-workspaces.desc": "Limited functionality in untrusted workspaces",
4043

4144
"runtime.help.title": "Secrets-LE Help",
@@ -46,12 +49,13 @@
4649
"runtime.help.support": "GitHub Issues: https://github.com/OffensiveEdge/secrets-le/issues",
4750

4851
"runtime.detect.no-editor": "No active editor. Please open a file first.",
52+
"runtime.detect.no-workspace": "No workspace open. Please open a workspace folder first.",
4953
"runtime.detect.progress": "Detecting secrets...",
5054
"runtime.detect.copied": "Results copied to clipboard",
5155
"runtime.detect.complete": "Detected {0} secrets in {1}ms",
5256
"runtime.detect.error": "Detection failed: {0}",
53-
"runtime.detect.found": "Found {0} potential secret(s)",
54-
"runtime.detect.none": "No secrets detected in this document",
57+
"runtime.detect.found": "Found {0} potential secret(s) in {1} file(s)",
58+
"runtime.detect.none": "No secrets detected in workspace ({0} files scanned)",
5559

5660
"runtime.sanitize.no-editor": "No active editor. Please open a file first.",
5761
"runtime.sanitize.progress": "Sanitizing content...",

src/telemetry/telemetry.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ export function createTelemetry(): Telemetry {
1515
let outputChannel: vscode.OutputChannel | undefined;
1616

1717
if (config.telemetryEnabled) {
18-
outputChannel = vscode.window.createOutputChannel(
19-
'{{DisplayName}}-LE Telemetry',
20-
);
18+
outputChannel = vscode.window.createOutputChannel('Secrets-LE Telemetry');
2119
}
2220

2321
return Object.freeze({

0 commit comments

Comments
 (0)