Skip to content

Commit c096e29

Browse files
author
Ross Bayer
committed
[Python: flake8] Update the utils/python_lint.py script to fail with a non-zero exit code if flake8 and flake8-import-order are not installed.
1 parent 7934cdf commit c096e29

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

utils/gyb.py

-10
Original file line numberDiff line numberDiff line change
@@ -1136,16 +1136,6 @@ def execute_template(
11361136

11371137

11381138
def main():
1139-
"""
1140-
Lint this file.
1141-
>>> import sys
1142-
>>> gyb_path = os.path.realpath(__file__).replace('.pyc', '.py')
1143-
>>> sys.path.append(os.path.dirname(gyb_path))
1144-
>>> import python_lint
1145-
>>> python_lint.lint([gyb_path], verbose=False)
1146-
0
1147-
"""
1148-
11491139
import argparse
11501140
import sys
11511141

utils/line-directive

-4
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,6 @@ def run():
659659
>>> raw_output.close()
660660
>>> os.remove(raw_output.name)
661661
662-
Lint this file.
663-
>>> import python_lint
664-
>>> python_lint.lint([os.path.realpath(__file__)], verbose=False)
665-
0
666662
"""
667663
if len(sys.argv) <= 1:
668664
import doctest

utils/python_lint.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def lint(args, verbose=False):
8484
if verbose:
8585
print(_INSTALL_FLAKE8_MESSAGE)
8686

87-
return 0
87+
return 1
8888

8989
return subprocess.call(
9090
[sys.executable, '-m', 'flake8'] + args,
+3-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
// Continuous integration for the OS X Platform also runs the tests in the
22
// iPhone, Apple TV and Apple Watch simulators. We only need to run the
3-
// build_swift module unit-tests once per OSX Platform test run, rather than
4-
// once for each supported Apple device.
3+
// Python lint once per OSX Platform test run, rather than once for each
4+
// supported Apple device.
55

6-
// UNSUPPORTED: OS=ios
7-
// UNSUPPORTED: OS=tvos
8-
// UNSUPPORTED: OS=watchos
6+
// REQUIRES: OS=macosx
97

108
// RUN: %{python} %utils/python_lint.py

0 commit comments

Comments
 (0)