Skip to content

Commit

Permalink
code_checker: Leverage .gitignore by using git ls-files instead of fi…
Browse files Browse the repository at this point in the history
…nd to get list of ifles to check
  • Loading branch information
jgfouca committed Aug 1, 2016
1 parent c269ab9 commit 009f7a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/Tools/code_checker
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ def check_code(dir_to_check, num_procs, files):
os.environ["PYTHONPATH"] = dir_to_check

# Get list of files to check
files_to_check = run_cmd_no_fail('find %s -name "*.py"' % dir_to_check).splitlines()
files_to_check = run_cmd_no_fail('git ls-files %s' % dir_to_check).splitlines()
if files:
files_to_check = [item for item in files_to_check if matches(item, files)]
else:
files_to_check = [item for item in files_to_check if item.endswith(".py")]

pool = ThreadPool(num_procs)
results = pool.map(run_pylint, files_to_check)
Expand Down

0 comments on commit 009f7a1

Please sign in to comment.