https://pantsbuild.org/ logo
#development
Title
# development
w

wide-midnight-78598

10/19/2022, 2:11 PM
🚲 🏚️ on shell completions naming (i.e. the goal that generates the shell completions script):
./pants complete
./pants completion
./pants completions
Other? I wanted something like
./pants --completion
- but since it's a built-in goal, I can't use options-style naming
If it's becoming something closer to a top-level goal, I would have preferred a verb - but then that's closer to
generate-completions
c

curved-television-6568

10/19/2022, 2:13 PM
There is a way to have it as an option style, but with caveats that it’ll also be a top level thing as you have above.. https://github.com/pantsbuild/pants/blob/1870d37d7ca8096ff3bd15c6e25fbb3c358a0af3/src/python/pants/goal/help.py#L93
hmm… maybe if
name = "_completions"
and
aliases = ("--completions",)
would hide the not option version…
w

wide-midnight-78598

10/19/2022, 2:14 PM
Oh, yeah, I saw the aliases - but since it ends up in both, it kinda becomes a "goal"
c

curved-television-6568

10/19/2022, 2:14 PM
yeah, it’ll still be a goal..
btw, I’m +1 for
completions
👍 1
w

wide-midnight-78598

10/19/2022, 2:15 PM
So, it would end up on this page fundamentally (https://www.pantsbuild.org/docs/reference-all-goals), even with the underscore
h

happy-kitchen-89482

10/19/2022, 2:56 PM
This is for the goal that generates a completions shell script?
w

wide-midnight-78598

10/19/2022, 2:59 PM
Yep
b

bitter-ability-32190

10/19/2022, 3:11 PM
(Is this in a plugin? Thats off by default and the user opts into?)
c

curved-television-6568

10/19/2022, 3:19 PM
builtin goals can’t be in plugins
b

bitter-ability-32190

10/19/2022, 3:19 PM
It could be a goal provided by a plugin tho, doens't have to be "builtin"
c

curved-television-6568

10/19/2022, 3:19 PM
true, just went of the OP’s
but since it’s a built-in goal,
b

bitter-ability-32190

10/19/2022, 3:20 PM
I ask because I think eventually it'd be dope if this didn't exist in favor of Stu's idea to autogen relevant exported artifacts (like venvs, or this file) and pulling the plug on a plugin goal is easier to stomach than a builtin one 😉
c

curved-television-6568

10/19/2022, 3:21 PM
b

bitter-ability-32190

10/19/2022, 3:22 PM
IDC about the name, but I don't want us to hog the goallist unless enabled. Especially considering we can see a future where the goal isn't required
w

wide-midnight-78598

10/19/2022, 3:22 PM
@curved-television-6568 Was providing context to Josh's comment about why it's a builtin
c

curved-television-6568

10/19/2022, 3:22 PM
Oh, k 😛
w

wide-midnight-78598

10/19/2022, 3:24 PM
I mean, my original idea was for completions to be part of
export
c

curved-television-6568

10/19/2022, 3:24 PM
IDC about the name, but I don’t want us to hog the goallist unless enabled. Especially considering we can see a future where the goal isn’t required
Well, if we’re to adopt the policy of “hiding” rather than removing features for stability reasons (Josh’s deprecation policy work) then we would likely keep it around regardless, but if not needed then as a hidden goal.
b

bitter-ability-32190

10/19/2022, 3:25 PM
We could also just pile in on the auto-gen feature >:)
👍 1
w

wide-midnight-78598

10/19/2022, 3:25 PM
🤷
c

curved-television-6568

10/19/2022, 3:28 PM
Keeping a builtin goal around I don’t see as such a big burden and is easy to implement today, where as the alternatives I believe requires more work (also on the design side) and the backend rules for the completions would likely be very close then as to now so my vote be to do what’s easy to unblock this now, and for the future we could simply hide it if it becomes an obsolete goal. No strong preference either way besides that 😉
b

bitter-ability-32190

10/19/2022, 3:29 PM
Yeah don't let me stop you. Just trying to peer ahead.
💯 1
c

curved-television-6568

10/19/2022, 3:29 PM
As am I 😄 (that is, I appreciate the balancing of a pro vs con approach to find the best way forward). no light without dark etc 😛
h

happy-kitchen-89482

10/19/2022, 5:15 PM
Does folding this into
export
make sense?
./pants export --bash-completions
?
💡 1
Now that we have plugin options for subsystems (🎉), we can make
export
a sensible place for this kind of thing
b

bitter-ability-32190

10/19/2022, 5:18 PM
(FWIW because of the builtin-nature it might need tobe baked directly into
export
. Thats OK though)
w

wide-midnight-78598

10/19/2022, 7:10 PM
Has export been modified in the last month or so? I thought it only worked for venvs? Original idea from July (https://github.com/pantsbuild/pants/pull/16200#issuecomment-1192063349) was as part of export or export-codegen
And I'm all +1's for fewer goals
h

happy-kitchen-89482

10/19/2022, 7:45 PM
Currently the only thing export exports is venvs, but it was always intended to be a general “get stuff out of Pants” goal. The problem was how to specify what you want to get out of it in a pluggable way. Plus, it tries to use cmd-line specs in a way that isn’t generically useful. But now that we have pluggability of options, the path is open for
export
to be what it was meant to be
👍 1
w

wide-midnight-78598

10/19/2022, 8:01 PM
So long as I can access
help-all
, I have zero qualms moving to
export