Skip to content

Commit 4c1b41c

Browse files
authored
Merge pull request #4 from swappsco/feat/smart-tests
Feat/smart tests
2 parents e05130e + b6a3798 commit 4c1b41c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/dev_tools_hooks/hooks/pre-commit

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ yaml_get() {
4747
in_section && /^[a-zA-Z]/ { in_section=0 }
4848
in_section && $0 ~ "^ "child":" {
4949
gsub(/^ [a-zA-Z_-]+:[ ]*/, "")
50+
gsub(/^[ \t]+|[ \t]+$/, "")
5051
gsub(/^["'\'']|["'\'']$/, "")
5152
gsub(/^[ \t]+|[ \t]+$/, "")
5253
print
@@ -57,6 +58,7 @@ yaml_get() {
5758
awk -v key="$key" '
5859
$0 ~ "^"key":" {
5960
gsub(/^[a-zA-Z_-]+:[ ]*/, "")
61+
gsub(/^[ \t]+|[ \t]+$/, "")
6062
gsub(/^["'\'']|["'\'']$/, "")
6163
gsub(/^[ \t]+|[ \t]+$/, "")
6264
print
@@ -255,7 +257,7 @@ run_commands() {
255257

256258
cd "$PROJECT_ROOT" || exit 1
257259

258-
if eval "$full_cmd"; then
260+
if eval "$full_cmd" </dev/null; then
259261
echo -e " ${GREEN}✔ Passed${NC}"
260262
else
261263
echo -e " ${RED}✖ Failed${NC}"

src/dev_tools_hooks/hooks/pre-push

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ yaml_get() {
5757
in_section && /^[a-zA-Z]/ { in_section=0 }
5858
in_section && $0 ~ "^ "child":" {
5959
gsub(/^ [a-zA-Z_-]+:[ ]*/, "")
60+
gsub(/^[ \t]+|[ \t]+$/, "")
6061
gsub(/^["'\'']|["'\'']$/, "")
6162
gsub(/^[ \t]+|[ \t]+$/, "")
6263
print
@@ -67,6 +68,7 @@ yaml_get() {
6768
awk -v key="$key" '
6869
$0 ~ "^"key":" {
6970
gsub(/^[a-zA-Z_-]+:[ ]*/, "")
71+
gsub(/^[ \t]+|[ \t]+$/, "")
7072
gsub(/^["'\'']|["'\'']$/, "")
7173
gsub(/^[ \t]+|[ \t]+$/, "")
7274
print
@@ -308,7 +310,7 @@ run_django_smart_tests() {
308310

309311
cd "$PROJECT_ROOT" || exit 1
310312

311-
if eval "$full_cmd"; then
313+
if eval "$full_cmd" </dev/null; then
312314
echo -e " ${GREEN}✔ Passed${NC}"
313315
echo ""
314316
return 0

0 commit comments

Comments
 (0)