Skip to content

Commit f40f951

Browse files
committed
Use 'diff_base' for pycodestyle check, if set.
Speeds it up, plus reduces spew when testing locally.
1 parent 72291ea commit f40f951

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/pycodestyle_on_repo.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@
2323
import subprocess
2424
import sys
2525

26+
from run_pylint import get_files_for_linting
27+
2628

2729
def main():
2830
"""Run pycodestyle on all Python files in the repository."""
2931
git_root = subprocess.check_output(
3032
['git', 'rev-parse', '--show-toplevel']).strip()
3133
os.chdir(git_root)
32-
python_files = subprocess.check_output(['git', 'ls-files', '*py'])
33-
python_files = python_files.strip().split()
34+
candidates, _ = get_files_for_linting()
35+
python_files = [
36+
candidate for candidate in candidates if candidate.endswith('.py')]
3437

3538
pycodestyle_command = ['pycodestyle'] + python_files
3639
status_code = subprocess.call(pycodestyle_command)

0 commit comments

Comments
 (0)