Skip to content

Commit d99222b

Browse files
committed
refactor(ng-dev): use the same symbols for failure, success and pending for terminal outputs (#2428)
Use the same symbols for all terminal outputs to expressing success (✔), pending (⏺) and failure (✘) PR Close #2428
1 parent 6e89d0a commit d99222b

File tree

13 files changed

+28
-28
lines changed

13 files changed

+28
-28
lines changed

.github/local-actions/changelog/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63600,7 +63600,7 @@ async function formatFiles(files) {
6360063600
Log.error(`Formatting failed, see errors above for more information.`);
6360163601
return 1;
6360263602
}
63603-
Log.info(green(`\u221A Formatting complete.`));
63603+
Log.info(green(`\u2714 Formatting complete.`));
6360463604
return 0;
6360563605
}
6360663606

ng-dev/caretaker/check/ci.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import semver from 'semver';
99

1010
import {AuthenticatedGitClient} from '../../utils/git/authenticated-git-client.js';
1111
import {ActiveReleaseTrains, ReleaseTrain} from '../../release/versioning/index.js';
12-
import {Log} from '../../utils/logging.js';
12+
import {green, Log} from '../../utils/logging.js';
1313
import {installVirtualGitClientSpies, mockNgDevConfig} from '../../utils/testing/index.js';
1414

1515
import {CiModule} from './ci.js';
@@ -125,7 +125,7 @@ describe('CiModule', () => {
125125
await module.printToTerminal();
126126

127127
expect(debugSpy).toHaveBeenCalledWith('No active release train for name1');
128-
expect(infoSpy).toHaveBeenCalledWith('label0 ✅');
128+
expect(infoSpy).toHaveBeenCalledWith(`label0 ${green('✔')}`);
129129
});
130130
});
131131

ng-dev/caretaker/check/ci.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from '../../release/versioning/index.js';
1515
import githubMacros from '../../utils/git/github-macros.js';
1616

17-
import {bold, Log} from '../../utils/logging.js';
17+
import {bold, green, Log, red, yellow} from '../../utils/logging.js';
1818
import {BaseModule} from './base.js';
1919

2020
/** The result of checking a branch on CI. */
@@ -81,11 +81,11 @@ export class CiModule extends BaseModule<CiData> {
8181
if (result.status === null) {
8282
Log.info(`${result.name} branch was not found on CI`);
8383
} else if (result.status === 'passing') {
84-
Log.info(`${label} `);
84+
Log.info(`${label} ${green('✔')}`);
8585
} else if (result.status === 'pending') {
86-
Log.info(`${label} 🟡`);
86+
Log.info(`${label} ${yellow('⏺')}`);
8787
} else {
88-
Log.info(`${label} `);
88+
Log.info(`${label} ${red('✘')}`);
8989
}
9090
});
9191
Log.info.groupEnd();

ng-dev/caretaker/check/g3.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {AuthenticatedGitClient} from '../../utils/git/authenticated-git-client.js';
10-
import {Log} from '../../utils/logging.js';
10+
import {green, Log} from '../../utils/logging.js';
1111
import {installVirtualGitClientSpies, mockNgDevConfig} from '../../utils/testing/index.js';
1212

1313
import {G3Module} from './g3.js';
@@ -75,7 +75,7 @@ describe('G3Module', () => {
7575
await module.printToTerminal();
7676

7777
expect(infoSpy).toHaveBeenCalledWith('25 commits between g3 and master');
78-
expect(infoSpy).toHaveBeenCalledWith('✅ No sync is needed at this time');
78+
expect(infoSpy).toHaveBeenCalledWith(` ${green('✔')} No sync is needed at this time`);
7979
});
8080
});
8181
});

ng-dev/caretaker/check/g3.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {bold, Log} from '../../utils/logging.js';
9+
import {bold, green, Log} from '../../utils/logging.js';
1010
import {G3StatsData, G3Stats} from '../../utils/g3.js';
1111

1212
import {BaseModule} from './base.js';
@@ -24,7 +24,7 @@ export class G3Module extends BaseModule<G3StatsData | void> {
2424
Log.info.group(bold('g3 branch check'));
2525
if (stats.files === 0 && stats.separateFiles === 0) {
2626
Log.info(`${stats.commits} commits between g3 and ${this.git.mainBranchName}`);
27-
Log.info('✅ No sync is needed at this time');
27+
Log.info(` ${green('✔')} No sync is needed at this time`);
2828
} else if (stats.separateFiles > 0) {
2929
Log.info(
3030
`${stats.separateFiles} primitives files changed, ${stats.files} Angular files changed, ` +

ng-dev/caretaker/check/services.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {AuthenticatedGitClient} from '../../utils/git/authenticated-git-client.js';
10-
import {Log} from '../../utils/logging.js';
10+
import {green, Log, red} from '../../utils/logging.js';
1111
import {installVirtualGitClientSpies, mockNgDevConfig} from '../../utils/testing/index.js';
1212

1313
import {services, ServicesModule} from './services.js';
@@ -68,9 +68,9 @@ describe('ServicesModule', () => {
6868
await module.printToTerminal();
6969

7070
expect(infoGroupSpy).toHaveBeenCalledWith('Service Statuses');
71-
expect(infoSpy).toHaveBeenCalledWith('Service 1 ✅');
71+
expect(infoSpy).toHaveBeenCalledWith(`Service 1 ${green('✔')}`);
7272
expect(infoGroupSpy).toHaveBeenCalledWith(
73-
`Service 2 (Updated: ${new Date(0).toLocaleString()})`,
73+
`Service 2 ${red('✘')} (Updated: ${new Date(0).toLocaleString()})`,
7474
);
7575
expect(infoSpy).toHaveBeenCalledWith(' Details: Literally everything is broken');
7676
expect(infoSpy).toHaveBeenCalledWith(' Status URL: http://notgoogle.com');

ng-dev/caretaker/check/services.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {bold, Log} from '../../utils/logging.js';
9+
import {bold, green, Log, red} from '../../utils/logging.js';
1010
import {BaseModule} from './base.js';
1111

1212
interface ServiceConfig {
@@ -69,9 +69,9 @@ export class ServicesModule extends BaseModule<StatusCheckResult[]> {
6969
for (const status of statuses) {
7070
const name = status.name.padEnd(serviceNameMinLength);
7171
if (status.status === 'passing') {
72-
Log.info(`${name} `);
72+
Log.info(`${name} ${green('✔')}`);
7373
} else {
74-
Log.info.group(`${name} (Updated: ${status.lastUpdated.toLocaleString()})`);
74+
Log.info.group(`${name} ${red('✘')} (Updated: ${status.lastUpdated.toLocaleString()})`);
7575
Log.info(` Details: ${status.description}`);
7676
Log.info(` Status URL: ${status.statusUrl}`);
7777
Log.info.groupEnd();

ng-dev/caretaker/handoff/update-github-team.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export async function updateCaretakerTeamViaPrompt() {
5454
}
5555

5656
if (JSON.stringify(selected) === JSON.stringify(current)) {
57-
Log.info(green(' Caretaker group already up to date.'));
57+
Log.info(green(' Caretaker group already up to date.'));
5858
return;
5959
}
6060

@@ -64,7 +64,7 @@ export async function updateCaretakerTeamViaPrompt() {
6464
Log.error(' ✘ Failed to update caretaker group.');
6565
return;
6666
}
67-
Log.info(green(' Successfully updated caretaker group'));
67+
Log.info(green(' Successfully updated caretaker group'));
6868
}
6969

7070
/** Retrieve the current list of members for the provided group. */

ng-dev/commit-message/validate-file/validate-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function validateFile(filePath: string, isErrorMode: boolean) {
2323
const commitMessage = readFileSync(resolve(git.baseDir, filePath), 'utf8');
2424
const {valid, errors} = await validateCommitMessage(commitMessage);
2525
if (valid) {
26-
Log.info(`${green('')} Valid commit message`);
26+
Log.info(`${green('')} Valid commit message`);
2727
deleteCommitMessageDraft(filePath);
2828
process.exitCode = 0;
2929
return;

ng-dev/commit-message/validate-range/validate-range.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function validateCommitRange(from: string, to: string): Promise<voi
5656
}
5757

5858
if (allCommitsInRangeValid) {
59-
Log.info(green(' All commit messages in range valid.'));
59+
Log.info(green(' All commit messages in range valid.'));
6060
} else {
6161
Log.error('✘ Invalid commit message');
6262
errors.forEach(([header, validationErrors]) => {

0 commit comments

Comments
 (0)