Skip to content

Commit f336344

Browse files
author
Alexis Grenier
committed
Fix CI still running full scan
1 parent 0f24b58 commit f336344

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

packages/react-doctor/src/cli.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ const program = new Command()
156156
const resolvedDirectory = path.resolve(directory);
157157
const userConfig = loadConfig(resolvedDirectory);
158158

159-
if (!isScoreOnly) {
160-
logger.log(`react-doctor v${VERSION}`);
159+
if (!isScoreOnly && !flags.hideBranding) {
160+
logger.log(\`react-doctor v\${VERSION}\`);
161161
logger.break();
162162
}
163163

@@ -181,7 +181,7 @@ const program = new Command()
181181
isScoreOnly,
182182
);
183183

184-
if (isDiffMode && diffInfo && !isScoreOnly) {
184+
if (isDiffMode && diffInfo && !isScoreOnly && !flags.hideBranding) {
185185
if (diffInfo.isCurrentChanges) {
186186
logger.log("Scanning uncommitted changes");
187187
} else {
@@ -201,8 +201,8 @@ const program = new Command()
201201
if (projectDiffInfo) {
202202
const changedSourceFiles = filterSourceFiles(projectDiffInfo.changedFiles);
203203
if (changedSourceFiles.length === 0) {
204-
if (!isScoreOnly) {
205-
logger.dim(`No changed source files in ${projectDirectory}, skipping.`);
204+
if (!isScoreOnly && !flags.hideBranding) {
205+
logger.dim(\`No changed source files in \${projectDirectory}, skipping.\`);
206206
logger.break();
207207
}
208208
continue;
@@ -211,13 +211,13 @@ const program = new Command()
211211
}
212212
}
213213

214-
if (!isScoreOnly) {
215-
logger.dim(`Scanning ${projectDirectory}...`);
214+
if (!isScoreOnly && !flags.hideBranding) {
215+
logger.dim(\`Scanning \${projectDirectory}...\`);
216216
logger.break();
217217
}
218218
const scanResult = await scan(projectDirectory, { ...scanOptions, includePaths });
219219
allDiagnostics.push(...scanResult.diagnostics);
220-
if (!isScoreOnly) {
220+
if (!isScoreOnly && !flags.hideBranding) {
221221
logger.break();
222222
}
223223
}

packages/react-doctor/src/scan.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,10 @@ export const scan = async (
587587
}
588588

589589
if (diagnostics.length === 0) {
590+
if (options.noBranding) {
591+
logger.log(buildNoBrandingReport(diagnostics, scoreResult));
592+
return { diagnostics, scoreResult, skippedChecks };
593+
}
590594
if (hasSkippedChecks) {
591595
const skippedLabel = skippedChecks.join(" and ");
592596
logger.warn(
@@ -610,7 +614,7 @@ export const scan = async (
610614
return { diagnostics, scoreResult, skippedChecks };
611615
}
612616

613-
printDiagnostics(diagnostics, options.verbose);
617+
if (!options.noBranding) printDiagnostics(diagnostics, options.verbose);
614618

615619
const displayedSourceFileCount = isDiffMode ? includePaths.length : projectInfo.sourceFileCount;
616620

@@ -625,7 +629,7 @@ export const scan = async (
625629
options.noBranding,
626630
);
627631

628-
if (hasSkippedChecks) {
632+
if (hasSkippedChecks && !options.noBranding) {
629633
const skippedLabel = skippedChecks.join(" and ");
630634
logger.break();
631635
logger.warn(` Note: ${skippedLabel} checks failed — score may be incomplete.`);

0 commit comments

Comments
 (0)