From 4ddc705d209e0253c4dd45d0341a0450b2d2e446 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Mon, 25 Jun 2018 17:00:40 +0530 Subject: [PATCH 1/2] Simplify linter configuration to be consistent --- setup.cfg | 12 +++++++++--- tox.ini | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/setup.cfg b/setup.cfg index 66c036df6..d811e7989 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,9 @@ [isort] skip = - _vendor - __main__.py + .tox, + .scratch, + _vendor, + data multi_line_output = 5 known_third_party = pip._vendor @@ -12,7 +14,11 @@ default_section = THIRDPARTY include_trailing_comma = true [flake8] -exclude = .tox,.idea,.scratch,*.egg,build,_vendor,data +exclude = + .tox, + .scratch, + _vendor, + data select = E,W,F [mypy] diff --git a/tox.ini b/tox.ini index 866db977f..46f0fb3e0 100644 --- a/tox.ini +++ b/tox.ini @@ -36,8 +36,8 @@ commands = [lint] deps = -r{toxinidir}/tools/lint-requirements.txt commands = - flake8 . - isort --recursive --check-only --diff src/pip tests + flake8 + isort --check-only --diff [testenv:lint-py2] basepython = python2 From c2b1ce9fdc3e46acf0fe1cb1950f529d8c8c0d95 Mon Sep 17 00:00:00 2001 From: Pradyun Gedam Date: Mon, 25 Jun 2018 17:00:54 +0530 Subject: [PATCH 2/2] Fix lint errors on newly covered files --- docs/conf.py | 2 +- setup.py | 2 +- src/pip/__main__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index e615e6be8..0d7ce04a3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -11,10 +11,10 @@ # All configuration values have a default; values that are commented out # serve to show the default. +import glob import os import re import sys -import glob on_rtd = os.environ.get('READTHEDOCS', None) == 'True' diff --git a/setup.py b/setup.py index f52160a8f..d15c09f80 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import os import re import sys -from setuptools import setup, find_packages +from setuptools import find_packages, setup here = os.path.abspath(os.path.dirname(__file__)) diff --git a/src/pip/__main__.py b/src/pip/__main__.py index 4609582c3..0c223f8c1 100644 --- a/src/pip/__main__.py +++ b/src/pip/__main__.py @@ -13,7 +13,7 @@ if __package__ == '': path = os.path.dirname(os.path.dirname(__file__)) sys.path.insert(0, path) -from pip._internal import main as _main # noqa +from pip._internal import main as _main # isort:skip # noqa if __name__ == '__main__': sys.exit(_main())