github.com/bazelbuild/bazel-gazelle@v0.36.1-0.20240520142334-61b277ba6fed/BUILD.bazel (about)

     1  load("@bazel_gazelle_is_bazel_module//:defs.bzl", "GAZELLE_IS_BAZEL_MODULE")
     2  load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
     3  load("@io_bazel_rules_go//go:def.bzl", "nogo")
     4  load("//:def.bzl", "gazelle", "gazelle_binary")
     5  
     6  # gazelle:prefix github.com/bazelbuild/bazel-gazelle
     7  # gazelle:exclude vendor
     8  # gazelle:exclude third_party
     9  # gazelle:exclude .bazelci
    10  # gazelle:exclude .bcr
    11  # gazelle:exclude .idea
    12  # gazelle:exclude .github
    13  # gazelle:exclude .vscode
    14  # gazelle:go_naming_convention import_alias
    15  gazelle(
    16      name = "gazelle",
    17      command = "fix",
    18      gazelle = ":gazelle_local",
    19  )
    20  
    21  # gazelle_ci is called from CI to verify the repo is up-to-date, see: .bazelci/presubmit.yml
    22  gazelle(
    23      name = "gazelle_ci",
    24      command = "fix",
    25      extra_args = ["--mode=diff"],
    26      gazelle = ":gazelle_local",
    27  )
    28  
    29  gazelle_binary(
    30      name = "gazelle_local",
    31      languages = [
    32          "//language/proto",
    33          "//language/go",
    34          "//internal/language/test_filegroup",
    35          "@bazel_skylib_gazelle_plugin//bzl" if GAZELLE_IS_BAZEL_MODULE else "@bazel_skylib//gazelle/bzl",
    36      ],
    37  )
    38  
    39  nogo(
    40      name = "nogo",
    41      vet = True,
    42      visibility = ["//visibility:public"],
    43      deps = ["@org_golang_x_tools//go/analysis/passes/copylock"],
    44  )
    45  
    46  exports_files([
    47      "WORKSPACE",
    48      "extend.md",
    49      "repository.md",
    50  ])
    51  
    52  filegroup(
    53      name = "all_files",
    54      testonly = True,
    55      # keep
    56      srcs = glob(["vendor/**"]) + [
    57          ".bazelrc",
    58          ".gitignore",
    59          "AUTHORS",
    60          "BUILD.bazel",
    61          "CODEOWNERS",
    62          "CONTRIBUTING.md",
    63          "CONTRIBUTORS",
    64          "Design.rst",
    65          "LICENSE",
    66          "README.rst",
    67          "WORKSPACE",
    68          "def.bzl",
    69          "deps.bzl",
    70          "extend.rst",
    71          "go.mod",
    72          "go.sum",
    73          "repository.rst",
    74          "//cmd:all_files",
    75          "//config:all_files",
    76          "//flag:all_files",
    77          "//internal:all_files",
    78          "//label:all_files",
    79          "//language:all_files",
    80          "//merger:all_files",
    81          "//pathtools:all_files",
    82          "//repo:all_files",
    83          "//resolve:all_files",
    84          "//rule:all_files",
    85          "//testtools:all_files",
    86          "//tools:all_files",
    87          "//walk:all_files",
    88      ],
    89      visibility = ["//visibility:public"],
    90  )
    91  
    92  bzl_library(
    93      name = "def",
    94      srcs = ["def.bzl"],
    95      visibility = ["//visibility:public"],
    96      deps = [
    97          "//internal:gazelle_binary",
    98          "//internal:go_repository",
    99          "//internal:overlay_repository",
   100          "//internal/generationtest",
   101          "@bazel_gazelle_is_bazel_module//:defs",
   102          "@bazel_skylib//lib:shell",
   103      ],
   104  )
   105  
   106  bzl_library(
   107      name = "deps",
   108      srcs = ["deps.bzl"],
   109      visibility = ["//visibility:public"],
   110      deps = [
   111          "//internal:go_repository",
   112          "//internal:go_repository_cache",
   113          "//internal:go_repository_config",
   114          "//internal:go_repository_tools",
   115          "//internal:is_bazel_module",
   116          "@bazel_tools//tools/build_defs/repo:git.bzl",
   117      ],
   118  )
   119  
   120  bzl_library(
   121      name = "extensions",
   122      srcs = ["extensions.bzl"],
   123      visibility = ["//visibility:public"],
   124      deps = ["//internal/bzlmod:go_deps"],
   125  )