microsoft/typespec

Public

mirrored fromhttps://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
61ba17d2d29dedf4553b21a055aa6b442a304688

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

eng/scripts/check-format.js

20lines · modecode

1// @ts-check
2import {
3 ensureDotnetVersion,
4 runDotnetFormat,
5} from "../../packages/internal-build-utils/dist/src/index.js";
6import { CommandFailedError, runPrettier } from "./helpers.js";
7
8try {
9 runPrettier("--list-different");
10 ensureDotnetVersion({ exitWithSuccessInDevBuilds: true });
11 runDotnetFormat("--verify-no-changes");
12} catch (err) {
13 if (err instanceof CommandFailedError) {
14 console.error(
15 "\nERROR: Files above are not formatted correctly. Run `rush format` and commit the changes."
16 );
17 process.exit(err.proc?.status ?? 1);
18 }
19 throw err;
20}
21