~allenap/maas/power-poll-fewer--bug-1389007

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: jtv at canonical
  • Date: 2014-10-01 07:22:16 UTC
  • mto: This revision was merged to the branch mainline in revision 3149.
  • Revision ID: jtv@canonical.com-20141001072216-0n7prdffifyxifvw
Run lint checks in parallel.  Not ideal, but the checks were getting really annoyingly slow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
        @find $(sources) -type f \
134
134
            -print0 | xargs -r0 $(pocketlint) --max-length=120
135
135
 
 
136
# Python lint checks are time-intensive, so we run them in parallel.  It may
 
137
# make things matters worse if the files need to be read from disk, though, so
 
138
# this may need more tuning.
 
139
# The -n50 -P4 setting roughly doubled speed on a high-end system with SSD and
 
140
# all the files in cache.
136
141
lint-py: sources = $(wildcard *.py contrib/*.py) src templates twisted utilities etc
137
142
lint-py: bin/flake8
138
 
        @find $(sources) -name '*.py' ! -path '*/migrations/*' \
139
 
            -print0 | xargs -r0 bin/flake8 --ignore=E123 --config=/dev/null
 
143
        @find $(sources) -name '*.py' ! -path '*/migrations/*' -print0 \
 
144
            | xargs -r0 -n50 -P4 bin/flake8 --ignore=E123 --config=/dev/null
140
145
        @./utilities/check-maaslog-exception
141
146
 
142
147
lint-doc:
143
148
        @./utilities/doc-lint
144
149
 
 
150
# JavaScript lint is checked in parallel for speed.  The -n20 -P4 seetting
 
151
# worked well on a multicore SSD machine with the files cached, roughly
 
152
# doubling the speed, but it may need tuning for slower systems or cold caches.
145
153
lint-js: sources = src/maasserver/static/js
146
154
lint-js:
147
 
        @find $(sources) -type f -print0 '(' -name '*.html' -o -name '*.js' ')' | xargs -r0 $(pocketlint)
 
155
        @find $(sources) -type f -print0 '(' -name '*.html' -o -name '*.js' ')' | xargs -r0 -n20 -P4 $(pocketlint)
148
156
 
149
157
# Apply automated formatting to all Python files.
150
158
format: sources = $(wildcard *.py contrib/*.py) src templates twisted utilities etc