mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 15:44:17 +00:00
Default jobs to cpu_count; closes #151
Instead of defaulting jobs to 1, default to cpu_count so everyone can take advantage of concurrency by default. This means most users will have one less configuration option that needs to be set.
This commit is contained in:
parent
ed6d0398bc
commit
b8539760f6
1 changed files with 5 additions and 1 deletions
|
|
@ -50,8 +50,12 @@ def get_parser():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if multiprocessing:
|
if multiprocessing:
|
||||||
|
try:
|
||||||
|
auto = multiprocessing.cpu_count() or 1
|
||||||
|
except NotImplimentedError:
|
||||||
|
auto =1
|
||||||
parser.config_options.append('jobs')
|
parser.config_options.append('jobs')
|
||||||
parser.add_option('-j', '--jobs', type='int', default=1,
|
parser.add_option('-j', '--jobs', type='int', default=auto,
|
||||||
help="number of jobs to run simultaneously")
|
help="number of jobs to run simultaneously")
|
||||||
|
|
||||||
parser.add_option('--exit-zero', action='store_true',
|
parser.add_option('--exit-zero', action='store_true',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue