https://pantsbuild.org/ logo
#general
Title
# general
h

high-yak-85899

04/27/2023, 4:32 PM
Is it possible to make
list
not give a warning if nothing matches? I didn't see an option and
--level=error
seems like a pretty heavy hammer to supress.
e

enough-analyst-54434

04/27/2023, 4:51 PM
Do you need stderr? You could just re-direct it.
I guess that amounts to the same heavy hammer if you're worried about pants list catastrophic failure you'd be blind to.
h

happy-kitchen-89482

04/29/2023, 1:13 AM
You can set
[GLOBAL].unmatched_cli_globs = "ignore"
h

high-yak-85899

05/01/2023, 5:13 PM
Hmm that does look like the option I want, but I'm not seeing any change. Here's an example with a file that doesn't exist.
Copy code
# File does not exist
(3.8.10) ~/devel/monorepo (timescale-crosstab)$ ls | grep not_a_file.py
# Explicit option doesn't change behavior
(3.8.10) ~/devel/monorepo (timescale-crosstab)$ ./pants --unmatched-cli-globs=ignore list not_a_file.py
11:12:12.16 [WARN] No targets were matched in goal `list`.
# Option in pants.toml has no effect
(3.8.10) ~/devel/monorepo (timescale-crosstab)$ ./pants list not_a_file.py
11:12:21.82 [WARN] No targets were matched in goal `list`.
e

enough-analyst-54434

05/01/2023, 5:20 PM
Ok, yeah:
Copy code
$ git grep "No targets were matched in goal"
src/python/pants/backend/project_info/list_targets.py:        logger.warning(f"No targets were matched in goal `{list_subsystem.name}`.")
So the
list
goal in particular adds its own level of nannying 😕