Skip to content

Commit

Permalink
Make pylint parallel (quantumlib#5144)
Browse files Browse the repository at this point in the history
On my local machine this took pylint from 3 minutes to less than one.
  • Loading branch information
dabacon authored and tonybruguier committed Apr 19, 2022
1 parent bed698a commit 4ee4db9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion check/pylint
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ cd "$(git rev-parse --show-toplevel)"
CIRQ_MODULES=$(env PYTHONPATH=. python dev_tools/modules.py list --mode package-path)

# Add dev_tools to $PYTHONPATH so that pylint can find custom checkers
env PYTHONPATH=dev_tools pylint --rcfile=dev_tools/conf/.pylintrc "$@" $CIRQ_MODULES dev_tools examples
env PYTHONPATH=dev_tools pylint --jobs=0 --rcfile=dev_tools/conf/.pylintrc "$@" $CIRQ_MODULES dev_tools examples
2 changes: 1 addition & 1 deletion check/pylint-changed-files
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ echo "Found ${num_changed} lintable files associated with changes." >&2
if [ "${num_changed}" -eq 0 ]; then
exit 0
fi
env PYTHONPATH=dev_tools pylint --rcfile=dev_tools/conf/.pylintrc "${changed[@]}"
env PYTHONPATH=dev_tools pylint --jobs=0 --rcfile=dev_tools/conf/.pylintrc "${changed[@]}"
2 changes: 1 addition & 1 deletion dev_tools/bash_scripts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def test_pylint_changed_files_file_selection(tmpdir_factory):
)

intercepted_prefix = (
'INTERCEPTED env PYTHONPATH=dev_tools pylint --rcfile=dev_tools/conf/.pylintrc '
'INTERCEPTED env PYTHONPATH=dev_tools pylint --jobs=0 --rcfile=dev_tools/conf/.pylintrc '
)

result = run(
Expand Down

0 comments on commit 4ee4db9

Please sign in to comment.