Skip to content

Commit f5de9f2

Browse files
committed
Changed: Adds prettier check to yaml-fix
Adds a check for the `prettier` command to the `yaml-fix` recipe. If `prettier` isn't found, it falls back to `npx` to ensure YAML files are consistently formatted. This improves the development experience by ensuring consistent code style.
1 parent 54533c8 commit f5de9f2

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

REFERENCES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ See references [1-3] below.
2020
### LDL^T factorization (symmetric SPD/PSD)
2121

2222
The LDL^T (often abbreviated "LDLT") implementation in `la-stack` is intended for symmetric positive
23-
definite (SPD) and positive semi-definite (PSD) matrices (e.g. Gram matrices), and does not perform
23+
definite (SPD) and positive semi-definite (PSD) matrices (e.g. Gram matrices), and does not perform
2424
pivoting.
2525

2626
For background on the SPD/PSD setting, see [4-5]. For pivoted variants used for symmetric *indefinite*

justfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ _ensure-npx:
2222
set -euo pipefail
2323
command -v npx >/dev/null || { echo "❌ 'npx' not found. See 'just setup' or install Node.js (for npx tools): https://nodejs.org"; exit 1; }
2424

25+
_ensure-prettier-or-npx:
26+
#!/usr/bin/env bash
27+
set -euo pipefail
28+
if command -v prettier >/dev/null; then
29+
exit 0
30+
fi
31+
command -v npx >/dev/null || {
32+
echo "❌ Neither 'prettier' nor 'npx' found. Install via npm (recommended): npm i -g prettier"
33+
echo " Or install Node.js (for npx): https://nodejs.org"
34+
exit 1
35+
}
36+
2537
_ensure-shellcheck:
2638
#!/usr/bin/env bash
2739
set -euo pipefail
@@ -517,7 +529,7 @@ validate-json: _ensure-jq
517529
fi
518530

519531
# YAML
520-
yaml-fix:
532+
yaml-fix: _ensure-prettier-or-npx
521533
#!/usr/bin/env bash
522534
set -euo pipefail
523535
files=()

0 commit comments

Comments
 (0)