-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
67 lines (51 loc) · 1.61 KB
/
Copy pathjustfile
File metadata and controls
67 lines (51 loc) · 1.61 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
# https://just.systems/man/en/
set fallback
J := just_executable() + ' --justfile ' + justfile()
# use it like this:
# {{enter_env}} CMD -- ARGS...
enter_env := 'devenv --quiet shell'
# called by default when no recipe is specified
[default]
@_default:
{{J}} --list --unsorted --color always
[positional-arguments]
@test-pytest *args:
{{enter_env}} python -- -m pytest --tb=short "$@"
@test-typecheck:
{{enter_env}} ty -- check
@test-fmt:
{{enter_env}} ruff -- format --check . || echo "NOTE: `just fmt` might fix that"
@update-snapshots *args:
find tests -type d -name ".snapshots" -prune -exec rm -rf {} \;
UPDATE_SNAPSHOTS=1 {{enter_env}} python -- -m pytest "$@"
# run all tests
test: test-pytest test-typecheck test-fmt
# format all files
@fmt:
{{enter_env}} ruff -- format .
# run the simplepatch cli
[no-exit-message]
[positional-arguments]
@cli *args:
{{enter_env}} python -- -m simplepatch "$@"
# run python with all dependencies installed
[no-exit-message]
[positional-arguments]
@py *args:
{{enter_env}} python -- "$@"
debug:
#!/usr/bin/env bash
shopt -s globstar nullglob
SEARCH_DIR=~/YaSONiC/patches
for file in "$SEARCH_DIR"/**/*.patch; do
echo -n "$file... "
# Get output filename by replacing extension
outfile="${file%.patch}.patch"
# Capture stdout, let stderr go to /dev/null
if output=$(python -m simplepatch convert --from git "$file" 2>/dev/null); then
echo "$output" > "$outfile"
echo -e "\033[32mOK\033[0m"
else
echo -e "\033[31mERR\033[0m"
fi
done