mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
10
utils/gyb.py
10
utils/gyb.py
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user