Skip to content

Commit

Permalink
Upgrade rules_go and known imports (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhp authored Jan 25, 2023
1 parent 8dfc8da commit 91dcc6c
Show file tree
Hide file tree
Showing 8 changed files with 5,968 additions and 6,548 deletions.
2 changes: 0 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,3 @@ build:ci --spawn_strategy=standalone
build:ci --genrule_strategy=standalone
test:ci --test_strategy=standalone
test:ci --test_output=errors

common --incompatible_disallow_empty_glob
12 changes: 6 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "io_bazel_rules_go",
sha256 = "56d8c5a5c91e1af73eca71a6fab2ced959b67c86d12ba37feedb0a2dfea441a6",
sha256 = "19ef30b21eae581177e0028f6f4b1f54c66467017be33d211ab6fc81da01ea4d",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.37.0/rules_go-v0.37.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.37.0/rules_go-v0.37.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.38.0/rules_go-v0.38.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.38.0/rules_go-v0.38.0.zip",
],
)

Expand All @@ -40,10 +40,10 @@ gazelle_dependencies()
# so we declare it in the WORKSPACE
http_archive(
name = "io_bazel_stardoc",
sha256 = "c9794dcc8026a30ff67cf7cf91ebe245ca294b20b071845d12c192afe243ad72",
sha256 = "3fd8fec4ddec3c670bd810904e2e33170bedfe12f90adf943508184be458c8bb",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz",
"https://github.com/bazelbuild/stardoc/releases/download/0.5.0/stardoc-0.5.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
"https://github.com/bazelbuild/stardoc/releases/download/0.5.3/stardoc-0.5.3.tar.gz",
],
)

Expand Down
22 changes: 11 additions & 11 deletions extend.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ includes the proto package name, as well as source names, imports, and options.
[proto.Package]: https://godoc.org/github.com/bazelbuild/bazel-gazelle/language/proto#Package


<a id="#gazelle_binary"></a>
<a id="gazelle_binary"></a>

## gazelle_binary

Expand All @@ -135,11 +135,11 @@ proto extension stores metadata in hidden attributes of generated

| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
| <a id="gazelle_binary-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="gazelle_binary-languages"></a>languages | A list of language extensions the Gazelle binary will use.<br><br> Each extension must be a [go_library] or something compatible. Each extension must export a function named <code>NewLanguage</code> with no parameters that returns a value assignable to [Language]. | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | required | |
| <a id="gazelle_binary-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="gazelle_binary-languages"></a>languages | A list of language extensions the Gazelle binary will use.<br><br> Each extension must be a [go_library] or something compatible. Each extension must export a function named <code>NewLanguage</code> with no parameters that returns a value assignable to [Language]. | <a href="https://bazel.build/concepts/labels">List of labels</a> | required | |


<a id="#gazelle_generation_test"></a>
<a id="gazelle_generation_test"></a>

## gazelle_generation_test

Expand All @@ -153,17 +153,17 @@ gazelle_generation_test(<a href="#gazelle_generation_test-name">name</a>, <a hre
The generation test expects a file structure like the following:

```
|-- <testDataPath>
|-- &lt;testDataPath&gt;
|-- some_test
|-- WORKSPACE
|-- README.md --> README describing what the test does.
|-- expectedStdout.txt --> Expected stdout for this test.
|-- expectedStderr.txt --> Expected stderr for this test.
|-- expectedExitCode.txt --> Expected exit code for this test.
|-- README.md --&gt; README describing what the test does.
|-- expectedStdout.txt --&gt; Expected stdout for this test.
|-- expectedStderr.txt --&gt; Expected stderr for this test.
|-- expectedExitCode.txt --&gt; Expected exit code for this test.
|-- app
|-- sourceFile.foo
|-- BUILD.in --> BUILD file prior to running gazelle.
|-- BUILD.out --> BUILD file expected after running gazelle.
|-- BUILD.in --&gt; BUILD file prior to running gazelle.
|-- BUILD.out --&gt; BUILD file expected after running gazelle.
```

To update the expected files, run `UPDATE_SNAPSHOTS=true bazel run //path/to:the_test_target`.
Expand Down
Loading

0 comments on commit 91dcc6c

Please sign in to comment.