133
133
@find $(sources) -type f \
134
134
-print0 | xargs -r0 $(pocketlint) --max-length=120
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
143
148
@./utilities/doc-lint
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
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)
149
157
# Apply automated formatting to all Python files.
150
158
format: sources = $(wildcard *.py contrib/*.py) src templates twisted utilities etc