Execute the assertion blocks with Python instead
This commit is contained in:
parent
d92713930e
commit
ad10b2cc4c
3 changed files with 9 additions and 1 deletions
|
|
@ -119,7 +119,11 @@ for commit_hash in "${commits[@]}"; do
|
||||||
echo "git-check-assertions block $block_num:"
|
echo "git-check-assertions block $block_num:"
|
||||||
printf '%s' "$block" | sed 's/^/> /'
|
printf '%s' "$block" | sed 's/^/> /'
|
||||||
check_assertions() {
|
check_assertions() {
|
||||||
bash -euo pipefail -c "$block"
|
python3 - "$block" <<-EOF
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
|
subprocess.run(sys.argv[1], shell=True, check=True)
|
||||||
|
EOF
|
||||||
}
|
}
|
||||||
if ! check_assertions; then
|
if ! check_assertions; then
|
||||||
echo "git-check-assertions block failed in $commit_hash" >&2
|
echo "git-check-assertions block failed in $commit_hash" >&2
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
shfmt,
|
shfmt,
|
||||||
perl,
|
perl,
|
||||||
coreutils,
|
coreutils,
|
||||||
|
python3,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
@ -44,6 +45,7 @@ resholve.mkDerivation {
|
||||||
shfmt
|
shfmt
|
||||||
perl
|
perl
|
||||||
coreutils
|
coreutils
|
||||||
|
python3
|
||||||
];
|
];
|
||||||
|
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
|
|
@ -72,6 +74,7 @@ resholve.mkDerivation {
|
||||||
bash
|
bash
|
||||||
perl
|
perl
|
||||||
coreutils
|
coreutils
|
||||||
|
python3
|
||||||
];
|
];
|
||||||
execer = [
|
execer = [
|
||||||
# Not true at all, but ¯\_(ツ)_/¯
|
# Not true at all, but ¯\_(ツ)_/¯
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
pkgs.perl
|
pkgs.perl
|
||||||
pkgs.shfmt
|
pkgs.shfmt
|
||||||
pkgs.coreutils
|
pkgs.coreutils
|
||||||
|
pkgs.python3
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue