hundreds-father-404
05/24/2022, 4:37 AM./pants test project:: '!project/integration_test::'
š
The issue is that you have to quote the !
or your shell won't be happy. So @curved-television-6568 suggested instead using -
, like -project/integration_test::
, which mirrors how --tag
works.
However, that causes ambiguity with short-flags like -dmy_custom_dir
, which equals --logdir=my_custom_dir
.
How do people feel about getting rid of *the ability for arbitrary short flags, to make room for ignore CLI args?hundreds-father-404
05/24/2022, 4:40 AM-l
, aka --level
⢠-d
, aka --logdir
. Which doesn't look like it actually is wired up to anything...
⢠-h
, aka --help
⢠-v
, aka --version
hundreds-father-404
05/24/2022, 4:40 AM-h
and -v
, and maybe -l
But generally, I believe that short flags are an antipattern w/ Pants, given how many options we have and how many things Pants does
Short flags are great with tools that have ~one purpose, like Pex and pip. But with Pants, it's too vague imohundreds-father-404
05/24/2022, 4:42 AM-ldebug
vs --level=debug
(6 char difference)...we could special case it in our arg parsing code-h
, -v
, and probably -l
given how frequently it's used
But otherwise, get rid of -d
== --logdir
and ban short args for plugin authorscurved-television-6568
05/24/2022, 5:00 AMhundreds-father-404
05/24/2022, 5:03 AMMy proposal is to special case -h, -v, and probably -l given how frequently it's usedThis was easy to get working with
args_parser.py
š So if people agree w/ the proposal, I'm confident we can implementcurved-television-6568
05/24/2022, 5:05 AMhundreds-father-404
05/24/2022, 5:06 AM-l
. -h
and -v
are already handled by being BuiltinGoal
This is all it is:
if not arg.startswith("--") or arg in {"-linfo", "-lwarn", "-ldebug", "-ltrace", "-lerror"}:
return False
-d
is an issue tho because it's not an enum and can have an arbitrary value. We'd have to do something like if arg.startswith('-d')
. But that means we might not recognize the value -dir
as a spec..., thinking you mean --logdir=ir
hahhundreds-father-404
05/24/2022, 5:35 AMarg_parser.py
happy, assuming we are fine removing -d
and banning plugin authors from using short flags https://github.com/Eric-Arellano/pants/commit/7f66bf4643fb1916b079380c4eed3b6ebda235b8
I would also add validation to parser.py
that short flags aren't being used beyond the blessed ones of -l
, -h
, and -v
happy-kitchen-89482
05/24/2022, 5:37 AM-d
bitter-ability-32190
05/24/2022, 10:28 AMbitter-ability-32190
05/24/2022, 10:30 AM-
now?
In bazel you have to "escape" it, bazel test //... -- -//foo/...
But that'd mess with passthrough args.
Can we get this working without --
?curved-television-6568
05/24/2022, 10:30 AM--
curved-television-6568
05/24/2022, 10:34 AMbitter-ability-32190
05/24/2022, 11:11 AM