@@ -504,12 +504,52 @@ sh_binary(
504504 ],
505505)
506506
507+ # --- Bazel linting (buildifier -lint=warn) --------------------------------
508+
509+ # buildifier: disable=native-sh-test
510+ sh_test (
511+ name = "lint_bzl_test" ,
512+ srcs = ["//bazel:bzl_lint_test.sh" ],
513+ args = ["$(rootpath @buildifier_prebuilt//:buildifier)" ],
514+ data = [
515+ "@buildifier_prebuilt//:buildifier" ,
516+ ],
517+ tags = ["local" ],
518+ )
519+
520+ # --- Bazel formatting check (buildifier -mode=check -lint=off) ------------
521+
522+ # buildifier: disable=native-sh-test
523+ sh_test (
524+ name = "fmt_bzl_test" ,
525+ srcs = ["//bazel:bzl_fmt_test.sh" ],
526+ args = ["$(rootpath @buildifier_prebuilt//:buildifier)" ],
527+ data = [
528+ "@buildifier_prebuilt//:buildifier" ,
529+ ],
530+ tags = ["local" ],
531+ )
532+
533+ # --- Bazel auto-format only (buildifier -mode=fix) ------------------------
534+
535+ # buildifier: disable=native-sh-binary
536+ sh_binary (
537+ name = "tidy_bzl" ,
538+ srcs = ["//bazel:bzl_tidy.sh" ],
539+ args = ["$(rootpath @buildifier_prebuilt//:buildifier)" ],
540+ data = [
541+ "@buildifier_prebuilt//:buildifier" ,
542+ ],
543+ )
544+
507545# --- Umbrella targets ------------------------------------------------------
508546
509547test_suite (
510548 name = "lint_test" ,
511549 tests = [
550+ ":fmt_bzl_test" ,
512551 ":fmt_tcl_test" ,
552+ ":lint_bzl_test" ,
513553 ":lint_tcl_test" ,
514554 ],
515555)
@@ -525,12 +565,19 @@ sh_binary(
525565 "$(rootpath //bazel:tclfmt)" ,
526566 "$(rootpath //bazel:tcl_lint_test.sh)" ,
527567 "$(rootpath //bazel:tclint)" ,
568+ "$(rootpath //bazel:bzl_tidy.sh)" ,
569+ "$(rootpath @buildifier_prebuilt//:buildifier)" ,
570+ "$(rootpath //bazel:bzl_lint_test.sh)" ,
571+ "$(rootpath @buildifier_prebuilt//:buildifier)" ,
528572 ],
529573 data = [
530574 "tclint.toml" ,
575+ "//bazel:bzl_lint_test.sh" ,
576+ "//bazel:bzl_tidy.sh" ,
531577 "//bazel:tcl_lint_test.sh" ,
532578 "//bazel:tcl_tidy.sh" ,
533579 "//bazel:tclfmt" ,
534580 "//bazel:tclint" ,
581+ "@buildifier_prebuilt//:buildifier" ,
535582 ],
536583)
0 commit comments