From 4090b773887600faaff0ea6a8af381dc7616db32 Mon Sep 17 00:00:00 2001 From: aspeddro Date: Sun, 29 Dec 2024 20:50:50 -0300 Subject: [PATCH] Unify check and formatting in one place Whenever I edit js files and run `make format` the js files are not formatted --- scripts/format.sh | 2 ++ scripts/format_check.sh | 2 ++ scripts/test.js | 5 ----- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/format.sh b/scripts/format.sh index 8d0265abe2..e96fa4c436 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -6,3 +6,5 @@ dune build @fmt --auto-promote files=$(find runtime tests -type f \( -name "*.res" -o -name "*.resi" \) ! -name "syntaxErrors*" ! -path "tests/syntax_*" ! -path "tests/analysis_tests/tests*" ! -path "tests/gentype_tests/typescript-react-example/node_modules") ./cli/rescript format $files + +npm run format diff --git a/scripts/format_check.sh b/scripts/format_check.sh index 588fcf4a3e..7c7282450b 100755 --- a/scripts/format_check.sh +++ b/scripts/format_check.sh @@ -30,3 +30,5 @@ case "$(uname -s)" in echo "Code formatting checks skipped for this platform." esac +echo "Biome format check" +npm run checkFormat diff --git a/scripts/test.js b/scripts/test.js index 8a88795650..bdd8ca2336 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -38,11 +38,6 @@ if (process.argv.includes("-all")) { async function runTests() { if (formatTest) { - cp.execSync("npm run checkFormat", { - cwd: path.join(__dirname, ".."), - stdio: [0, 1, 2], - }); - cp.execSync("bash scripts/format_check.sh", { cwd: path.join(__dirname, ".."), stdio: [0, 1, 2],