Skip to content

Commit

Permalink
feat(packager): Add file path to security check and metrics progress …
Browse files Browse the repository at this point in the history
…message
  • Loading branch information
yamadashy committed Sep 23, 2024
1 parent b473e87 commit 99eb3c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/core/packager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'node:fs/promises';
import path from 'node:path';
import pMap from 'p-map';
import pc from 'picocolors';
import type { RepopackConfigMerged } from '../config/configTypes.js';
import { logger } from '../shared/logger.js';
import { getProcessConcurrency } from '../shared/processConcurrency.js';
Expand Down Expand Up @@ -93,7 +94,7 @@ export const pack = async (
const charCount = file.content.length;
const tokenCount = tokenCounter.countTokens(file.content);

progressCallback(`Calculating metrics... (${index + 1}/${processedFiles.length})`);
progressCallback(`Calculating metrics... (${index + 1}/${processedFiles.length}) ${pc.dim(file.path)}`);

// Sleep for a short time to prevent blocking the event loop
await sleep(1);
Expand Down
3 changes: 2 additions & 1 deletion src/core/security/securityCheckRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { lintSource } from '@secretlint/core';
import { creator } from '@secretlint/secretlint-rule-preset-recommend';
import type { SecretLintCoreConfig, SecretLintCoreResult } from '@secretlint/types';
import pMap from 'p-map';
import pc from 'picocolors';
import { logger } from '../../shared/logger.js';
import { getProcessConcurrency } from '../../shared/processConcurrency.js';
import { sleep } from '../../shared/sleep.js';
Expand Down Expand Up @@ -31,7 +32,7 @@ export const runSecurityCheck = async (
};
}

progressCallback(`Running security check... (${index + 1}/${rawFiles.length})`);
progressCallback(`Running security check... (${index + 1}/${rawFiles.length}) ${pc.dim(rawFile.path)}`);

// Sleep for a short time to prevent blocking the event loop
await sleep(1);
Expand Down

0 comments on commit 99eb3c1

Please sign in to comment.