Skip to content

Conversation

lf-
Copy link

@lf- lf- commented Jul 17, 2025

This interprets BXL files as bzl, which they basically are. It also interprets BUCK files as BUILD, which they also are.

Ref: https://buck2.build/docs/bxl/

This interprets BXL files as bzl, which they basically are.
It also interprets BUCK files as BUILD, which they also are.

Ref: https://buck2.build/docs/bxl/
@lf-
Copy link
Author

lf- commented Jul 17, 2025

I dunno how to write a meaningful test for this change.

@vladmos
Copy link
Member

vladmos commented Jul 21, 2025

There is an existing test in lex_test.go, please just add the new filenames there.

Please also add non-trivial combinations such as buck.bzl or BUILD.bxl (which should resolve to TypeBzl).

@vladmos
Copy link
Member

vladmos commented Jul 21, 2025

Do you want to fix the formatting or the warnings? This change will cause all Bazel-specific warnings (that are normally applied only to BUILD/.bzl files) to be applied to the Buck files as well.

If you only want to fix the formatting, then you don't need to do anything to bxl files (all unknown files are formatted as bzl), and create another filetype for BUCK files (maybe call it TypeDefaultBuild instead of TypeBuck as it's not BUCK-specific but only suggests that the file should be formatted using BUILD file rules).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants