Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gazelle): Add "include_dep" Python comment annotation (#1863)
Add a new Python comment annotation for Gazelle: `include_dep`. This annotation accepts a comma-separated string of values. Values _should_ be targets names, but no validation is done. The annotation can be added multiple times, and all values are combined and de-duplicated. For `python_generation_mode = "package"`, the `include_dep` annotations found across all files included in the generated target. The `parser.annotations` struct is updated to include a new `includeDep` field, and `parser.parse` is updated to return the `annotations` struct. All target builders then add the resolved dependencies. Fixes #1862. Example: ```python # gazelle:include_dep //foo:bar,:hello_world,//:abc # gazelle:include_dep //:def,//foo:bar ``` will cause gazelle to generate: ```starlark deps = [ ":hello_world", "//:abc", "//:def", "//foo:bar", ] ``` --------- Co-authored-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
- Loading branch information
1 parent
d3cec48
commit a1d3c0d
Showing
35 changed files
with
379 additions
and
13 deletions.
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
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
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
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 @@ | ||
# gazelle:python_generation_mode file |
Oops, something went wrong.