mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-25 06:03:55 +03:00
setup: introduce --jobs for pylint
Pylint supports configuring jobs to use multiple processes to speed up Pylint. Default value is 1. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
4b108a8c75
commit
ec266d3cda
12
setup.py
12
setup.py
@ -563,13 +563,17 @@ class TestInitrdInject(TestBaseCommand):
|
|||||||
|
|
||||||
|
|
||||||
class CheckPylint(distutils.core.Command):
|
class CheckPylint(distutils.core.Command):
|
||||||
user_options = []
|
user_options = [
|
||||||
|
("jobs=", "j", "use multiple processes to speed up Pylint"),
|
||||||
|
]
|
||||||
description = "Check code using pylint and pycodestyle"
|
description = "Check code using pylint and pycodestyle"
|
||||||
|
|
||||||
def initialize_options(self):
|
def initialize_options(self):
|
||||||
pass
|
self.jobs = None
|
||||||
|
|
||||||
def finalize_options(self):
|
def finalize_options(self):
|
||||||
pass
|
if self.jobs:
|
||||||
|
self.jobs = int(self.jobs)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
files = ["setup.py", "virt-install", "virt-clone",
|
files = ["setup.py", "virt-install", "virt-clone",
|
||||||
@ -592,6 +596,8 @@ class CheckPylint(distutils.core.Command):
|
|||||||
cmd = "pylint-2 "
|
cmd = "pylint-2 "
|
||||||
else:
|
else:
|
||||||
cmd = "pylint "
|
cmd = "pylint "
|
||||||
|
if self.jobs:
|
||||||
|
cmd += "--jobs=%d " % self.jobs
|
||||||
cmd += "--rcfile tests/pylint.cfg "
|
cmd += "--rcfile tests/pylint.cfg "
|
||||||
cmd += "--output-format=%s " % output_format
|
cmd += "--output-format=%s " % output_format
|
||||||
cmd += "--ignore %s " % ",".join(
|
cmd += "--ignore %s " % ",".join(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user