fix: make fmt refuses to run without the repo's own prettier (closes #509)
In a clone where script/bootstrap has not run, node_modules/ is empty and yarn falls back to whatever prettier is on the PATH, which can format files differently from the version yarn.lock pins. script/fmt and script/fmt-check now stop with a message telling the user to run script/bootstrap when node_modules/.bin/prettier is missing. After bootstrap they behave as before. The README Entrypoints entries say so. Model: opus-5-5
This commit is contained in:
@@ -26,6 +26,13 @@ run_yarn() {
|
||||
|
||||
main() {
|
||||
cd "$ROOT"
|
||||
# Without the repo's own prettier, yarn runs whatever prettier is on
|
||||
# the PATH, which may be a version that formats files differently.
|
||||
if [ ! -x node_modules/.bin/prettier ]; then
|
||||
echo "fmt-check: this repo's prettier is not installed in" \
|
||||
"node_modules/, so run script/bootstrap first." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Checking formatting..."
|
||||
run_yarn run fmt-check
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user