File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change 2222from argparse import ArgumentParser
2323from os import environ
2424from pathlib import Path
25- from subprocess import run
25+ from subprocess import SubprocessError , run
2626from typing import List
2727
2828source_root = Path (environ ['MESON_SOURCE_ROOT' ])
@@ -61,7 +61,7 @@ def run_mypy() -> None:
6161 )
6262
6363
64- def linter_main () -> None :
64+ def run_flake8 () -> None :
6565 run (
6666 args = (
6767 'flake8' ,
@@ -70,7 +70,22 @@ def linter_main() -> None:
7070 check = True ,
7171 )
7272
73- run_mypy ()
73+
74+ def linter_main () -> None :
75+ is_success = True
76+
77+ try :
78+ run_flake8 ()
79+ except SubprocessError :
80+ is_success = False
81+
82+ try :
83+ run_mypy ()
84+ except SubprocessError :
85+ is_success = False
86+
87+ if not is_success :
88+ raise SystemExit (1 )
7489
7590
7691def get_all_python_files () -> List [Path ]:
You can’t perform that action at this time.
0 commit comments