Skip to content

Commit e41ccdf

Browse files
Suppress python callstacks on lint/ts/scss command failure
1 parent ba791ab commit e41ccdf

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

evap/evaluation/management/commands/scss.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import subprocess # nosec
1+
import subprocess
2+
import sys
23

34
from django.conf import settings
45
from django.core.management.base import BaseCommand, CommandError
@@ -34,7 +35,7 @@ def handle(self, *args, **options):
3435
command += ["--style", "compressed", "--no-source-map"]
3536

3637
try:
37-
subprocess.run(command, check=True) # nosec
38+
sys.exit(subprocess.run(command, check=False).returncode)
3839
except FileNotFoundError as e:
3940
raise CommandError("Could not find sass command") from e
4041
except KeyboardInterrupt:

evap/evaluation/management/commands/ts.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import argparse
2-
import subprocess # nosec
2+
import subprocess
3+
import sys
34

45
from django.conf import settings
56
from django.core.management import call_command
@@ -36,7 +37,7 @@ def handle(self, *args, **options):
3637

3738
def run_command(self, command):
3839
try:
39-
subprocess.run(command, check=True) # nosec
40+
sys.exit(subprocess.run(command, check=False).returncode)
4041
except FileNotFoundError as e:
4142
raise CommandError(f"Could not find {command[0]} command") from e
4243
except KeyboardInterrupt:

evap/evaluation/management/commands/typecheck.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import subprocess # nosec
1+
import subprocess
2+
import sys
23

34
from django.core.management.base import BaseCommand
45

@@ -9,4 +10,4 @@ class Command(BaseCommand):
910
requires_migrations_checks = False
1011

1112
def handle(self, *args, **options):
12-
subprocess.run(["mypy"], check=True) # nosec
13+
sys.exit(subprocess.run(["mypy"], check=False).returncode)

0 commit comments

Comments
 (0)