Skip to content

Commit 298787f

Browse files
committed
Get lint running on all Python files
1 parent f3f7eab commit 298787f

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

.flake8

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
exclude =
44
compat.py,
5-
src/hypothesis/vendor/,
5+
hypothesis-python/src/hypothesis/vendor/*,
66
test_reflection.py,
77
test_imports.py,
8-
tests/py2,
8+
hypothesis-python/tests/py2/*,
99
test_lambda_formatting.py
1010
ignore = D1,D205,D209,D213,D400,D401,D999

tooling/src/hypothesistooling/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def tags():
4040

4141

4242
ROOT = subprocess.check_output([
43-
'git', '-C', os.path.dirname(__file__), 'rev-parse', '--show-toplevel',
43+
'git', '-C', os.path.dirname(__file__), 'rev-parse', '--show-toplevel',
4444
]).decode('ascii').strip()
4545

4646
HYPOTHESIS_PYTHON = os.path.join(ROOT, 'hypothesis-python')

tooling/src/hypothesistooling/__main__.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ def task(fn):
4545

4646
@task
4747
def lint():
48-
os.chdir(tools.HYPOTHESIS_PYTHON)
49-
pip_tool('flake8', 'src', 'tests', '--config', os.path.join(
50-
tools.ROOT, '.flake8'
51-
))
48+
pip_tool(
49+
'flake8',
50+
*[f for f in tools.all_files() if f.endswith('.py')],
51+
'--config', os.path.join(tools.ROOT, '.flake8'),
52+
)
5253

5354

5455
@task

tooling/src/hypothesistooling/scripts.py

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def tool_path(name):
5555

5656

5757
def pip_tool(name, *args, **kwargs):
58+
print(name, *map(shlex.quote, args))
5859
r = subprocess.call([tool_path(name), *args], **kwargs)
5960

6061
if r != 0:

0 commit comments

Comments
 (0)