Hey! These docs are for version 2.0, which is no longer officially supported. Click here for the latest version, 2.7!
./pants filter [args]

Filter the input targets based on various criteria.

Config section: [filter]

Basic options

--filter-output-file=<path>
PANTS_FILTER_OUTPUT_FILE
output_file
default: None
Output the goal's stdout to this file. If unspecified, outputs to stdout.

--filter-sep=<separator>
PANTS_FILTER_SEP
sep
default: \n
String to use to separate lines in line-oriented output.

--filter-target-type="[[+-]type1,type2,..., [+-]type1,type2,..., ...]"
PANTS_FILTER_TARGET_TYPE
target_type
default: []
Filter on these target types, e.g. `resources` or `python_library`.

--filter-address-regex="[[+-]regex1,regex2,..., [+-]regex1,regex2,..., ...]"
PANTS_FILTER_ADDRESS_REGEX
address_regex
default: []
Filter on target addresses matching these regexes.

--filter-tag-regex="[[+-]regex1,regex2,..., [+-]regex1,regex2,..., ...]"
PANTS_FILTER_TAG_REGEX
tag_regex
default: []
Filter on targets with tags matching these regexes.

Advanced options

None

Deprecated options

--filter-type="[[+-]type1,type2,..., [+-]type1,type2,..., ...]"
PANTS_FILTER_TYPE
type
default: []
Deprecated, will be removed in version: 2.1.0.dev0
Use `--target-type` instead of `--type`.
Filter on these target types, e.g. `resources` or `python_library`.

--filter-regex="[[+-]regex1,regex2,..., [+-]regex1,regex2,..., ...]"
PANTS_FILTER_REGEX
regex
default: []
Deprecated, will be removed in version: 2.1.0.dev0
Use `--address-regex` instead of `--regex`.
Filter on target addresses matching these regexes.

--filter-target="[[+-]spec1,spec2,..., [+-]spec1,spec2,..., ...]"
PANTS_FILTER_TARGET
target
default: []
Deprecated, will be removed in version: 2.1.0.dev0
`--filter-target` was removed because it is similar to `--filter-address-regex`. If you still need this feature, please message us on Slack (https://www.pantsbuild.org/docs/community).
Filter on these target addresses.

--filter-ancestor="[[+-]spec1,spec2,..., [+-]spec1,spec2,..., ...]"
PANTS_FILTER_ANCESTOR
ancestor
default: []
Deprecated, will be removed in version: 2.1.0.dev0
`--filter-ancestor` was removed because it is not trivial to implement. If you still need this feature, please message us on Slack (https://www.pantsbuild.org/docs/community).
Filter on targets that these targets depend on.

Related subsystems

filter


Did this page help you?