Skip to content

Commit 4ee4db9

Browse files
dabacontonybruguier
authored andcommitted
Make pylint parallel (quantumlib#5144)
On my local machine this took pylint from 3 minutes to less than one.
1 parent bed698a commit 4ee4db9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

check/pylint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ cd "$(git rev-parse --show-toplevel)"
1414
CIRQ_MODULES=$(env PYTHONPATH=. python dev_tools/modules.py list --mode package-path)
1515

1616
# Add dev_tools to $PYTHONPATH so that pylint can find custom checkers
17-
env PYTHONPATH=dev_tools pylint --rcfile=dev_tools/conf/.pylintrc "$@" $CIRQ_MODULES dev_tools examples
17+
env PYTHONPATH=dev_tools pylint --jobs=0 --rcfile=dev_tools/conf/.pylintrc "$@" $CIRQ_MODULES dev_tools examples

check/pylint-changed-files

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ echo "Found ${num_changed} lintable files associated with changes." >&2
6666
if [ "${num_changed}" -eq 0 ]; then
6767
exit 0
6868
fi
69-
env PYTHONPATH=dev_tools pylint --rcfile=dev_tools/conf/.pylintrc "${changed[@]}"
69+
env PYTHONPATH=dev_tools pylint --jobs=0 --rcfile=dev_tools/conf/.pylintrc "${changed[@]}"

dev_tools/bash_scripts_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ def test_pylint_changed_files_file_selection(tmpdir_factory):
638638
)
639639

640640
intercepted_prefix = (
641-
'INTERCEPTED env PYTHONPATH=dev_tools pylint --rcfile=dev_tools/conf/.pylintrc '
641+
'INTERCEPTED env PYTHONPATH=dev_tools pylint --jobs=0 --rcfile=dev_tools/conf/.pylintrc '
642642
)
643643

644644
result = run(

0 commit comments

Comments
 (0)