Is it possible to make `list` not give a warning i...
# general
h
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
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
You can set
[GLOBAL].unmatched_cli_globs = "ignore"
h
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
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 😕