Skip to content

Commit 866db27

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.
(cherry picked from commit c096e29)
1 parent 533ddf3 commit 866db27

File tree

5 files changed

+9
-21
lines changed

5 files changed

+9
-21
lines changed

utils/gyb.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,16 +1133,6 @@ def execute_template(
11331133

11341134

11351135
def main():
1136-
"""
1137-
Lint this file.
1138-
>>> import sys
1139-
>>> gyb_path = os.path.realpath(__file__).replace('.pyc', '.py')
1140-
>>> sys.path.append(os.path.dirname(gyb_path))
1141-
>>> import python_lint
1142-
>>> python_lint.lint([gyb_path], verbose=False)
1143-
0
1144-
"""
1145-
11461136
import argparse
11471137
import sys
11481138

utils/line-directive

Lines changed: 0 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
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,

validation-test/Python/python-lint.swift

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Continuous integration for the OS X Platform also runs the tests in the
2+
// iPhone, Apple TV and Apple Watch simulators. We only need to run the
3+
// Python lint once per OSX Platform test run, rather than once for each
4+
// supported Apple device.
5+
6+
// REQUIRES: OS=macosx
7+
8+
// RUN: %{python} %utils/python_lint.py

0 commit comments

Comments
 (0)