Skip to content

Commit 9b2fd40

Browse files
committed
chore(build): Replace check.sh with granular Justfile recipes
Remove the monolithic check.sh script in favor of fine-grained Justfile recipes (fmt, lint, test, check) and small shell wrappers. This gives faster feedback by short-circuiting on first failure and keeps CI output silent on success. Also drops unused JS/Node tooling (biome, prettier, mdl) and consolidates pre-commit to a single hook.
1 parent bb26ce6 commit 9b2fd40

7 files changed

Lines changed: 111 additions & 263 deletions

File tree

Justfile

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,47 @@
11
default:
22
@just --list
33

4-
build:
5-
eask recompile
6-
4+
# Run the ERT test suite.
75
test:
8-
eask run script test
6+
@scripts/run-tests.sh
7+
8+
# Lint + test — the combined pre-commit entrypoint.
9+
check: fmt lint test
10+
11+
fmt: elisp-autofmt shfmt
12+
13+
elisp-autofmt:
14+
@scripts/quiet.sh eask format elisp-autofmt
15+
16+
shfmt:
17+
@shfmt -i 4 -l -w scripts/quiet.sh scripts/run-tests.sh
18+
19+
# Run the full lint suite (silent on success; failing stage writes
20+
# .lint-output.txt and exits non-zero, short-circuiting the rest).
21+
lint: byte-compile elisp-lint org-lint shellcheck zizmor
22+
@echo "lint: OK"
23+
24+
# --- Individual lint stages -------------------------------------------------
25+
# Each recipe is a thin wrapper around scripts/quiet.sh; silent on
26+
# success, writes failing-stage output to .lint-output.txt on failure.
27+
28+
byte-compile:
29+
@scripts/quiet.sh eask recompile
30+
31+
elisp-lint:
32+
@rm -f ./*.elc
33+
@scripts/quiet.sh eask lint elisp-lint; rc=$?; rm -f ./*.elc; exit $rc
34+
35+
org-lint:
36+
@scripts/quiet.sh eask run script org-lint
37+
38+
shellcheck:
39+
@scripts/quiet.sh shellcheck scripts/quiet.sh scripts/run-tests.sh
40+
41+
zizmor:
42+
@scripts/quiet.sh zizmor .github/workflows/claude-code-review.yml .github/workflows/claude.yml .github/workflows/elisp-test.yml
943

10-
lint:
11-
./check.sh
44+
# --- Passthrough ------------------------------------------------------------
1245

1346
act *args:
1447
act {{args}}

biome.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

check.sh

Lines changed: 0 additions & 218 deletions
This file was deleted.

flake.nix

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@
2424
...
2525
}: {
2626
pre-commit.settings.hooks = {
27-
lint = {
27+
# Single combined hook so pre-commit only emits one status line
28+
# (`check.....Passed`) on success. The recipe runs lint first,
29+
# then tests, and aborts on the first failure.
30+
check = {
2831
enable = true;
29-
name = "lint";
30-
entry = "just lint";
31-
pass_filenames = false;
32-
};
33-
test = {
34-
enable = true;
35-
name = "test";
36-
entry = "just test";
32+
name = "check";
33+
entry = "just check";
3734
pass_filenames = false;
3835
};
3936
};
@@ -57,14 +54,6 @@
5754
# GitHub Actions checks
5855
# checkov
5956
zizmor
60-
61-
# Markdown / text
62-
mdl
63-
prettier
64-
65-
# JSON / JS
66-
biome
67-
nodejs
6857
];
6958
shellHook = ''
7059
${config.pre-commit.installationScript}

org-mcp-test.el

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
(setq mcp-server-lib-ert-server-id "org-mcp")
1616

17+
;; Emit only ERT's concise batch output (one-line summary on success,
18+
;; failing tests' backtraces + condition blocks on failure).
19+
(setq ert-quiet t)
20+
1721
;;; Test Data Constants
1822

1923
;; Initial content strings for various test scenarios

scripts/quiet.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
# quiet.sh — run a lint stage silently; always capture its output to
3+
# .lint-output.txt, and on failure point the user at the file.
4+
#
5+
# Usage: scripts/quiet.sh CMD [ARGS...]
6+
# Success: exits 0 with no output.
7+
# Failure: prints "lint failed: output at .lint-output.txt" and
8+
# propagates the command's exit code.
9+
10+
set -u
11+
12+
if [ "$#" -lt 1 ]; then
13+
printf 'usage: %s CMD [ARGS...]\n' "$0" >&2
14+
exit 2
15+
fi
16+
17+
OUTFILE=".lint-output.txt"
18+
19+
"$@" >"$OUTFILE" 2>&1
20+
rc=$?
21+
if [ "$rc" -ne 0 ]; then
22+
printf 'lint failed: output at %s\n' "$OUTFILE"
23+
exit "$rc"
24+
fi

0 commit comments

Comments
 (0)