Skip to main content
Version: 2.0.x (deprecated)

filter


pants filter [args]

Filter the input targets based on various criteria.

Backend: pants.core

Config section: [filter]

Basic options

output_file

--filter-output-file=<path>
PANTS_FILTER_OUTPUT_FILE
default: None

Output the goal's stdout to this file. If unspecified, outputs to stdout.

sep

--filter-sep=<separator>
PANTS_FILTER_SEP
default: \n

String to use to separate lines in line-oriented output.

target_type

--filter-target-type="[[+-]type1,type2,..., [+-]type1,type2,..., ...]"
PANTS_FILTER_TARGET_TYPE
default: []

Filter on these target types, e.g. resources or python_library.

address_regex

--filter-address-regex="[[+-]regex1,regex2,..., [+-]regex1,regex2,..., ...]"
PANTS_FILTER_ADDRESS_REGEX
default: []

Filter on target addresses matching these regexes.

tag_regex

--filter-tag-regex="[[+-]regex1,regex2,..., [+-]regex1,regex2,..., ...]"
PANTS_FILTER_TAG_REGEX
default: []

Filter on targets with tags matching these regexes.

Advanced options

None

Deprecated options

type

--filter-type="[[+-]type1,type2,..., [+-]type1,type2,..., ...]"
PANTS_FILTER_TYPE
default: []

Filter on these target types, e.g. resources or python_library.

regex

--filter-regex="[[+-]regex1,regex2,..., [+-]regex1,regex2,..., ...]"
PANTS_FILTER_REGEX
default: []

Filter on target addresses matching these regexes.

target

--filter-target="[[+-]spec1,spec2,..., [+-]spec1,spec2,..., ...]"
PANTS_FILTER_TARGET
default: []

Filter on these target addresses.

ancestor

--filter-ancestor="[[+-]spec1,spec2,..., [+-]spec1,spec2,..., ...]"
PANTS_FILTER_ANCESTOR
default: []

Filter on targets that these targets depend on.