From f420f86bec7186153b689d391904275fc61a545f Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Thu, 17 Jul 2025 12:58:57 -0700 Subject: [PATCH] feat: autodetect buck2 file names 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/ --- build/lex.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/lex.go b/build/lex.go index 30639ea1a..0df79a166 100644 --- a/build/lex.go +++ b/build/lex.go @@ -137,12 +137,14 @@ func getFileType(filename string) FileType { switch ext { case ".bzl": return TypeBzl + case ".bxl": // Buck eXtension Language + return TypeBzl case ".sky": return TypeDefault } base := basename[:len(basename)-len(ext)] switch { - case ext == ".build" || base == "build" || strings.HasPrefix(base, "build."): + case ext == ".build" || base == "build" || base == "buck" || strings.HasPrefix(base, "build."): return TypeBuild case ext == ".workspace" || base == "workspace" || strings.HasPrefix(base, "workspace."): return TypeWorkspace