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

happy-kitchen-89482

03/19/2022, 7:22 PM
I notice that we don't document the special-case of the DEFAULT section in pants.toml. This was a holdover from the pants.ini days, where, for backwards compatibility with Python's configfile parser, if you request a value for
bar
in section
foo
, and it doesn't exist, but there is a
bar
in section
DEFAULT
, then that latter value will be returned. There doesn't seem to be much need for this functionality any more (it made a little more sense when we had recursive options) so I propose deprecating it, unless people are strongly relying on it. Please comment in thread if you have opinions on this, thanks!
b

bitter-ability-32190

03/19/2022, 7:37 PM
My only opinion is less is more 😊
3
h

happy-kitchen-89482

03/19/2022, 7:45 PM
I guess the other thing you can do with DEFAULT is set values that can be interpolated into other values
But that still seems not that useful, and even if we want that functionality the DEFAULT is not the right place for it, since those will also act as values
(you can also interpolate from a value in the same section, but again - that means it has to be a real option value that passes validation)
Possibly we should only support interpolation with the seed values like buildroot, homedir, user, pants_workdir, pants_distdir
b

bitter-ability-32190

03/19/2022, 8:01 PM
(I'm biased because I'm on an "ergonomic options" crusade)
💯 1
5 Views