[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.

This commit is contained in:
Ross Bayer
2020-02-03 11:07:29 -08:00
parent 7934cdf9c3
commit c096e29967
4 changed files with 4 additions and 20 deletions

View File

@@ -1136,16 +1136,6 @@ def execute_template(
def main():
"""
Lint this file.
>>> import sys
>>> gyb_path = os.path.realpath(__file__).replace('.pyc', '.py')
>>> sys.path.append(os.path.dirname(gyb_path))
>>> import python_lint
>>> python_lint.lint([gyb_path], verbose=False)
0
"""
import argparse
import sys

View File

@@ -659,10 +659,6 @@ def run():
>>> raw_output.close()
>>> os.remove(raw_output.name)
Lint this file.
>>> import python_lint
>>> python_lint.lint([os.path.realpath(__file__)], verbose=False)
0
"""
if len(sys.argv) <= 1:
import doctest

View File

@@ -84,7 +84,7 @@ def lint(args, verbose=False):
if verbose:
print(_INSTALL_FLAKE8_MESSAGE)
return 0
return 1
return subprocess.call(
[sys.executable, '-m', 'flake8'] + args,

View File

@@ -1,10 +1,8 @@
// Continuous integration for the OS X Platform also runs the tests in the
// iPhone, Apple TV and Apple Watch simulators. We only need to run the
// build_swift module unit-tests once per OSX Platform test run, rather than
// once for each supported Apple device.
// Python lint once per OSX Platform test run, rather than once for each
// supported Apple device.
// UNSUPPORTED: OS=ios
// UNSUPPORTED: OS=tvos
// UNSUPPORTED: OS=watchos
// REQUIRES: OS=macosx
// RUN: %{python} %utils/python_lint.py