-
-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add buildifier as a BUILD file formatter #16573
Conversation
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
I'm fine with having it in repo. Until the plugin API is stable, a burden is imposed on external plugins as APIs change. Post API stabilization, we can figure out whether to externalize plugins en-masse. |
src/python/pants/backend/build_files/fmt/buildifier/rules_integration_test.py
Outdated
Show resolved
Hide resolved
I've thought about this more. I think the best middle-groud to all this is in-repo but out of |
That was the v1 approach to all plugins. I don't see a ton of benefit to this: the versioning of the plugin is closely coupled to pantsbuild.pants itself. As long as a backend doesn't add new requirements, then there seems to be little cost to adding to pantsbuild.pants (trivially bigger package size). |
This is the first plugin I actually question if it belongs here in the Pants repo, and not in another package. It's a bit of an abuse to run Bazel's Starlark formatter on Pants BUILD files, but:
BUILD
files are relatively declarative. Only one I've seen is Starlark doesn't allow implicit string concat. I kinda like that 😛Additionally, this PR does not add any rules for running
buildifier
'slint
capabilities as I don't think Pants would trigger those and not be a false positive. Once we implement #16560 it might be worthwhile.[ci skip-rust]
[ci skip-build-wheels]