Skip to content

Commit 7e657e5

Browse files
authored
Merge pull request swiftlang#8238 from hughbe/python-lint-exitcode
Integrate python-lint into validation tests
2 parents 82d295f + 639c0be commit 7e657e5

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

utils/python-lint

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ def main():
2424
if flake8_result != 0:
2525
print("Missing modules flake8 or flake8-import-order. Please be sure "
2626
"to install these python packages before linting.")
27+
sys.exit(0)
2728

2829
utils_directory = os.path.dirname(os.path.abspath(__file__))
2930
parent_directory = os.path.dirname(utils_directory)
30-
subprocess.call(
31+
linting_result = subprocess.call(
3132
[sys.executable, "-m", "flake8"] + sys.argv[1:],
3233
cwd=parent_directory,
3334
universal_newlines=True
3435
)
36+
sys.exit(linting_result)
3537

3638

3739
if __name__ == '__main__':

utils/swift_build_support/tests/test_workspace.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def test_workspace(self):
5050

5151
class ComputeBuildSubdirTestCase(unittest.TestCase):
5252

53-
def create_basic_args(self, generator, variant, assertions, enable_asan=False):
53+
def create_basic_args(self, generator, variant, assertions,
54+
enable_asan=False):
5455
return argparse.Namespace(
5556
cmake_generator=generator,
5657
cmark_build_variant=variant,
@@ -139,7 +140,8 @@ def test_all_combinations_are_unique(self):
139140

140141
def generate():
141142
for c in productions:
142-
args = argparse.Namespace(cmake_generator="Ninja", enable_asan=False)
143+
args = argparse.Namespace(cmake_generator="Ninja",
144+
enable_asan=False)
143145
for key, val in zip(keys, c):
144146
setattr(args, key, val)
145147
yield compute_build_subdir(args)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// RUN: %{python} %utils/python-lint

0 commit comments

Comments
 (0)