Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create Gazelle language for Starlark (#251)
- Loading branch information
Showing
54 changed files
with
838 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
* @c-parsons @laurentlb @jin @aiuto | ||
distribution/ @aiuto @fwe | ||
rules/ @juliexxia | ||
gazelle/ @achew22 @jayconrod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary") | ||
|
||
# gazelle:exclude testdata | ||
|
||
go_library( | ||
name = "go_default_library", | ||
srcs = ["gazelle.go"], | ||
importpath = "github.com/bazelbuild/bazel-skylib/gazelle", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"@bazel_gazelle//config:go_default_library", | ||
"@bazel_gazelle//label:go_default_library", | ||
"@bazel_gazelle//language:go_default_library", | ||
"@bazel_gazelle//pathtools:go_default_library", | ||
"@bazel_gazelle//repo:go_default_library", | ||
"@bazel_gazelle//resolve:go_default_library", | ||
"@bazel_gazelle//rule:go_default_library", | ||
"@com_github_bazelbuild_buildtools//build:go_default_library", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "go_default_test", | ||
srcs = ["gazelle_test.go"], | ||
data = [ | ||
":gazelle-skylib", | ||
] + glob([ | ||
"testdata/**", | ||
]), | ||
embed = [":go_default_library"], | ||
deps = [ | ||
"@bazel_gazelle//testtools:go_default_library", | ||
"@io_bazel_rules_go//go/tools/bazel:go_default_library", | ||
], | ||
) | ||
|
||
# This gazelle binary is used exclusively for testing the gazelle language | ||
# extension and thus only has the skylib language installed. | ||
gazelle_binary( | ||
name = "gazelle-skylib", | ||
languages = [":go_default_library"], | ||
visibility = [ | ||
# Also make the binary available in the root of the repo for use, but | ||
# not externally. | ||
"//:__pkg__", | ||
], | ||
) | ||
|
||
gazelle( | ||
name = "gazelle", | ||
gazelle = "//gazelle:gazelle-skylib", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Gazelle | ||
|
||
Gazelle is a `BUILD` file generator for Bazel. This directory contains a | ||
language extension for the Gazelle generator that allows it to automatically | ||
parse valid `bzl_library` targets for all `.bzl` files in a repo in which it | ||
runs. It will additionally include a `deps` entry tracking every `.bzl` that is | ||
`load`ed into the primary file. | ||
|
||
This can be used, for example, to generate | ||
[`stardoc`](https://github.com/bazelbuild/stardoc) documentation for your | ||
`.bzl` files, both simplify the task of and improve the quality of | ||
documentation. | ||
|
Oops, something went wrong.