Skip to content

Commit 4287d7f

Browse files
committed
fix(fmt): clarify formatting fix command
1 parent 2cd11dc commit 4287d7f

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/rstack/src/fmt/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,9 +248,9 @@ const logFmtResult = (
248248
if (differentCount > 0) {
249249
const differentFiles = formatFileCount(differentCount, true);
250250
const processedFiles = formatFileCount(processedFileCount);
251-
const checkOption = color.cyan('--check');
251+
const fmtCommand = color.cyan('rs fmt');
252252
logger.error(
253-
`Formatting issues found in ${differentFiles}. Run without ${checkOption} to fix.`,
253+
`Formatting issues found in ${differentFiles}. Run ${fmtCommand} to fix.`,
254254
);
255255
logger.info(`Checked ${processedFiles} in ${prettyTime(durationSeconds)}.`);
256256
} else if (result.exitCode === 0) {

packages/rstack/tests/cli/check.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ test('runs lint followed by a formatting check', () => {
3636

3737
expect(unformatted.status).toBe(1);
3838
expect(unformatted.stdout).toContain('Checking formatting...');
39-
expect(unformatted.stderr).toContain('Formatting issues found in 1 file.');
39+
expect(unformatted.stderr).toContain(
40+
'Formatting issues found in 1 file. Run rs fmt to fix.',
41+
);
4042

4143
writeProjectFile('src/index.ts', 'const value = true;\n');
4244
const formatted = runCheck();

packages/rstack/tests/cli/fmt/files.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ test('checks formatting without writing files', () => {
108108
);
109109
expect(result.stderr).toContain('error index.ts');
110110
expect(normalizeDuration(result.stderr)).toContain(
111-
'error Formatting issues found in 1 file. Run without --check to fix.',
111+
'error Formatting issues found in 1 file. Run rs fmt to fix.',
112112
);
113113
expect(readProjectFile('index.ts')).toBe(source);
114114

0 commit comments

Comments
 (0)