Skip to content

Commit 001e86c

Browse files
DmitryVasilevskyDmitry Vasilevsky
and
Dmitry Vasilevsky
authored
Specific suggestion what to run if formatting check fails (#2220)
This change suggests running specific command 'npm run prettier:fix' to fix prettier errors if the formatting check fails. Could be hard to figure out what to run by just looking at 'Run Prettier with --write to fix' message. Co-authored-by: Dmitry Vasilevsky <[email protected]>
1 parent f621de1 commit 001e86c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ def use_python_env(folder):
174174

175175
if args.check:
176176
step_start("Running eslint and prettier checks")
177-
subprocess.run([npm_cmd, "run", "check"], check=True, text=True, cwd=root_dir)
177+
try:
178+
subprocess.run([npm_cmd, "run", "check"], check=True, text=True, cwd=root_dir)
179+
except subprocess.CalledProcessError:
180+
print("Consider running 'npm run prettier:fix' to fix prettier errors.")
181+
raise
178182

179183
if build_wasm or build_cli:
180184
# If we're going to check the Rust code, do this before we try to compile it

0 commit comments

Comments
 (0)