lint
pants lint [args]
Run linters/formatters/fixers in check mode.
Backend: pants.core
Config section: [lint]
Basic options
only
--lint-only="['<str>', '<str>', ...]"
PANTS_LINT_ONLY
[lint]
only = [
'<str>',
'<str>',
...,
]
[]
Only run these linters and skip all others.
The linter names are outputted at the final summary of running this goal, e.g. flake8
and shellcheck
. You can also run lint --only=fake
to get a list of all activated linters.
You can repeat this option, e.g. lint --only=flake8 --only=shellcheck
or lint --only=['flake8', 'shellcheck']
.
skip_fixers
--[no-]lint-skip-fixers
PANTS_LINT_SKIP_FIXERS
[lint]
skip_fixers = <bool>
False
If true, skip running all fixers in check-only mode.
FYI: when running /home/josh/work/scie-pants/dist/pants fix lint ::
, there should be diminishing performance benefit to using this flag. Pants attempts to reuse the results from fix
when running lint
where possible.
skip_formatters
--[no-]lint-skip-formatters
PANTS_LINT_SKIP_FORMATTERS
[lint]
skip_formatters = <bool>
False
If true, skip running all formatters in check-only mode.
FYI: when running /home/josh/work/scie-pants/dist/pants fmt lint ::
, there should be diminishing performance benefit to using this flag. Pants attempts to reuse the results from fmt
when running lint
where possible.
Advanced options
batch_size
--lint-batch-size=<int>
PANTS_LINT_BATCH_SIZE
[lint]
batch_size = <int>
128
The target number of files to be included in each linter batch.
Linter processes are batched for a few reasons:
1. to avoid OS argument length limits (in processes which don't support argument files)
2. to support more stable cache keys than would be possible if all files were operated on in a single batch.
3. to allow for parallelism in linter processes which don't have internal parallelism, or -- if they do support internal parallelism -- to improve scheduling behavior when multiple processes are competing for cores and so internal parallelism cannot be used perfectly.
In order to improve cache hit rates (see 2.), batches are created at stable boundaries, and so this value is only a "target" batch size (rather than an exact value).
Deprecated options
None