And while I'm fishing. I need a home for the `BUIL...
# development
b
And while I'm fishing. I need a home for the
BUILD
file deprecations fixer. I'm proposing we might want a "meta" bucket for backends and this might belong (because eventually it'll encompass
pants.toml
and be a bit of a "deprecations" fixer for all of Pants) Other "meta" plugins that could join • Plugin to find and error on redundant
dependencies
declarations Thoughts?
p
meta sounds good to me
w
hm… there is an existing buildfile deprecations fixer, but its name is not coming to me … cc @curved-television-6568…?
c
@witty-crayon-22786 Do you think of the BUILD file fixer that fixes targets and fields.. It’s all in a core goal only: https://github.com/pantsbuild/pants/blob/main/src/python/pants/core/goals/update_build_files.py
w
…ah, of course.
yea, thanks.
👍 1
c
then there’s a backend for formatting build files, apparently 😛
w
i misunderstood @bitter-ability-32190’s question i think: sorry. he’s asking where to move the existing code
c
np 🙂
b
Yes exactly! 😅
We do have
pants.backend.project_info
. I think that might be more natural place for these.
Alternatively we could move the build file formatters over there too, and just in time before 2.14 is released. Thoughts? @hundreds-father-404 @curved-television-6568 @happy-kitchen-89482
c
I have no strong opinions in this.. 😉
💪 1
💭 1
1
I so wanted to write onions rather than opinions though 😛
🧅 1
b
We do have
pants.backend.project_info
. I think that might be more natural place for these.
(Then the next question becomes "on by default?") re: deprecation fixers. Maybe why not? lol. Formatters and other fixers, not so much
👍 1
c
well, that could be tricky actually… as they’d likely hit during pants upgrades only right.. and so you want to tread carefully, and certainly having things fixed auto”magically” may trip you up..
b
In this case it'd be the deprecations fixers only, not other fixers. Those should be safe to fix magically. I'm also happy to keep it off by default.
c
… or it could save you from stumbling, … yea
As long as any changes made are really verbose to ensure it is not missed that they were applied, that would be good, I think
b
I'd argue that's what source-code-control is for 😉
h
I don't think project info makes sense, which is about understanding your own repo via introspection. Instead I'd say something like
pants.backend.pants_metadata.fmt.black
b
Technically we don't say what
project_info
entails. I think of it as the rules/goals which allow Pants/you to understand your project. To that end, your
BUILD
files and
pants.toml
describe your project as much as their content.
h
Yeah,
project_info
is intended to be for introspection goals, so BUILD files are relevant, not sure if formatting them is
h
I don't think formatting and fixing deprecated field renames is the spirit of
project_introspection
. Those two tasks don't give you any new insights on how your project is structured - they only help you more effectively manage Pants boilerplate / metadata
w
is the goal to be able to enable/disable the fixer without fallout?
b
FWIW it isn't
project_introspection
though, it's
project_info
😅 So
pants.backend.project_info.fmt
contains plugins to format your project info (
pants.toml
and
BUILD
files)
h
this is all hand-wavey, but I think it depends on what we mean with "project info". In my headstory, Pants metadata is really hints about your code so we can give better introspection. it's not the interesting stuff users care about. Pants is only the instrument But that story kind of falls apart with
list
and
peek
goals, which are 100% only about pants abstractions and not your own code
b
Wherever we land, I also suggest we move the
build_file
formatters there too, and cherry pick to 2.14, so we don't introduce-and-then-immediately-deprecate within two versions 🙂
I'll make a discussion for this. FWIW IMO it's blocking 2.14 and also https://github.com/pantsbuild/pants/pull/17240
p
Is the fix goal in 2.14?
h
2.15 2.14 adds the new backends for BUILD file formatting
☝️ 1
b
Yeha I don't wanna give users whiplash
Alternatively, some "Stomachable Whiplash" (band name, called it) would be for 2.14 to hide them behind
preview
🙂
p
Got it. When I opened that PR it has
Fix
all over the place, so I was confused.
b
Its a straw breaking the camels back here
p
Those poor camels... ;)
🐫 2
💸 1