Skip to main content
Version: 2.1 (deprecated)

filter


pants filter [args]

Filter the input targets based on various criteria.

Backend: ``

Config section: [filter]

Basic options

address_regex

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

Filter on target addresses matching these regexes.

output_file

--filter-output-file=<path>
PANTS_FILTER_OUTPUT_FILE
pants.toml
[filter]
output_file = <path>
default: None

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

sep

--filter-sep=<separator>
PANTS_FILTER_SEP
pants.toml
[filter]
sep = <separator>
default: \n

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

tag_regex

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

Filter on targets with tags matching these regexes.

target_type

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

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

Advanced options

None

Deprecated options

None

None