Skip to content

Commit 3ba4cea

Browse files
committed
Update docs
1 parent 4b6fda5 commit 3ba4cea

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

gazelle/docs/directives.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ The Python-specific directives are:
155155
* Default: `false`
156156
* Allowed Values: `true`, `false`
157157

158+
[`# gazelle:python_generate_pyi_srcs bool`](#python-generate-pyi-srcs)
159+
: Controls whether to generate a `pyi_srcs` attribute if a sibling `.pyi` file
160+
is found. When `false` (default), the `pyi_srcs` attribute is not added.
161+
* Default: `false`
162+
* Allowed Values: `true`, `false`
163+
158164
[`# gazelle:python_generate_proto bool`](#python-generate-proto)
159165
: Controls whether to generate a {bzl:obj}`py_proto_library` for each
160166
{bzl:obj}`proto_library` in the package. By default we load this rule from the
@@ -626,6 +632,28 @@ Detailed docs are not yet written.
626632
:::
627633

628634

635+
## `python_generate_pyi_deps`
636+
637+
When `true`, include any sibling `.pyi` files in the `pyi_srcs` target attribute.
638+
639+
For example, assume you have the following files:
640+
641+
```
642+
foo.py
643+
foo.pyi
644+
```
645+
646+
The generated target will be:
647+
648+
```starlark
649+
py_library(
650+
name = "foo",
651+
srcs = ["foo.py"],
652+
pyi_srcs = ["foo.pyi"],
653+
)
654+
```
655+
656+
629657
## `python_generate_proto`
630658

631659
When `# gazelle:python_generate_proto true`, Gazelle will generate one

0 commit comments

Comments
 (0)