Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions utils/gyb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions utils/line-directive
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion utils/python_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 3 additions & 5 deletions validation-test/Python/python_lint.swift
Original file line number Diff line number Diff line change
@@ -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