A poll: should the new `./pants update-build-files...
# general
A poll: should the new
./pants update-build-files
use Black by default, or you have to opt into it with an option? Beyond autoformatting, the goal automates fixing some safe deprecations like renaming target names + for opt-out, - for opt-in. Comments also welcomed :)
How about using black by default if that backend is listed in backend_packages in the configuration?
I think that we want to decouple using Black for your own code vs. BUILD files. For example, if you don't have any Python, you should not need to activate
to get this feature Or, if you have Python but aren't ready for Pants to run on in. Activating
would result in Python insisting with
./pants tailor
that it adds targets for Python code
(Still trying to think through though how interpreter discover + interpreter constraints should work here. Such as if we use
here. What about
How about using black by default if that backend is listed in backend_packages in the configuration?
Also generally I think it's a smell to have to document "The default depends if you set this other option." Makes it harder to reason about things. Keep It Simple
👍 1
In that case I think opt-in for using black on BUILD files.
To minimize surprises, and perhaps more importantly, the potential diff of changes applied.
That's the part tripping me up: the first time you run for existing users. You probably don't want Black enabled by default when upgrading from Pants 2.7 to 2.8 and to instead run it in a followup But, brand new users likely would want Black enabled by default with
. Even if they don't like Black for their own code, I imagine people are less opinionated with the formatting style of their BUILD files, as they're implementation details of a tool they use. So my personal vote is +1 to on-by-default, but then in our 2.8 release blog, maybe share a tip for existing users to use
the first time
Or how about always use black, but an option to disable all else. Then for existing users, you can do a fmt run first.
I think you should be able to turn off Black, but yeah agreed generally with that. I'm thinking we have
with default
for both Not sure if we need
to get more granular, like
--fixes=['renamed_targets', 'pex_entry_point']
. I don't think so, seems like overkill. Emphasis that the goal only does safe changes like renames
👍 1