-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathjustfile
More file actions
77 lines (62 loc) · 2.1 KB
/
Copy pathjustfile
File metadata and controls
77 lines (62 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import "./just/base.just"
import "./just/csv.just"
# ---------------------------------------------------------------------------- #
# DEPENDENCIES #
# ---------------------------------------------------------------------------- #
# BATS: https://github.com/bats-core/bats-core
bats := require("bats")
# ShellCheck: https://github.com/koalaman/shellcheck
shellcheck := require("shellcheck")
# shfmt: https://github.com/mvdan/shfmt
shfmt := require("shfmt")
# ---------------------------------------------------------------------------- #
# CONSTANTS #
# ---------------------------------------------------------------------------- #
GLOBS_SHELL := ```
shopt -s globstar nullglob
arr=(
**/*.bats
**/*.sh
)
echo "${arr[@]}"
```
# ---------------------------------------------------------------------------- #
# SCRIPTS #
# ---------------------------------------------------------------------------- #
[group("checks")]
@full-check:
just _run-with-status prettier-check
just _run-with-status biome-check
just _run-with-status shell-check
echo ""
echo '{{ GREEN }}All checks passed!{{ NORMAL }}'
@full-write:
just _run-with-status prettier-write
just _run-with-status biome-write
just _run-with-status shell-write
echo ""
echo '{{ GREEN }}All code fixes applied!{{ NORMAL }}'
# Check shell scripts with ShellCheck and shfmt
[group("checks")]
@shell-check:
shellcheck -x {{ GLOBS_SHELL }}
shfmt -d {{ GLOBS_SHELL }}
# Format shell scripts with shfmt
[group("checks")]
@shell-write:
shfmt -w {{ GLOBS_SHELL }}
# Run CSV validation tests using BATS
[group("tests")]
@test-csv:
echo "Running CSV validation tests..."
bats tests/csv.bats
# Run TSV validation tests using BATS
[group("tests")]
@test-tsv:
echo "Running TSV validation tests..."
bats tests/tsv.bats
# Run all BATS tests
[group("tests")]
@test:
bats tests/*.bats
alias t := test