Skip to content

Commit 0fafcd8

Browse files
authored
docs(gazelle): Add versionadded details to some Gazelle directives.md (bazel-contrib#3624)
Also fixup `CHANGELOG.md` typo. Wait for bazel-contrib#3623
1 parent 8a9cd71 commit 0fafcd8

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ END_UNRELEASED_TEMPLATE
107107
* (binaries/tests) Build information is now included in binaries and tests.
108108
Use the `bazel_binary_info` module to access it. The {flag}`--stamp` flag will
109109
add {obj}`--workspace_status_command` information.
110-
* (gazelle) A new directive `python_generate_pyi_deps` has been added. When
110+
* (gazelle) A new directive `python_generate_pyi_srcs` has been added. When
111111
`true`, a `py_*` target's `pyi_srcs` attribute will be set if any `.pyi` files
112112
that are associated with the target's `srcs` are present.
113113
([#3354](https://github.com/bazel-contrib/rules_python/issues/3354)).

gazelle/docs/directives.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,10 @@ Detailed docs are not yet written.
343343
(directive-python-proto-naming-convention)=
344344
## `python_proto_naming_convention`
345345

346+
:::{versionadded} 1.6.0
347+
{gh-pr}`3093`
348+
:::
349+
346350
Set this directive to a string pattern to control how the generated
347351
{bzl:obj}`py_proto_library` targets are named. When generating new
348352
{bzl:obj}`py_proto_library` rules, Gazelle will replace `$proto_name$` in the
@@ -393,6 +397,10 @@ Detailed docs are not yet written.
393397
(directive-python-default-visibility)=
394398
## `python_default_visibility`
395399

400+
:::{versionadded} 0.32.0
401+
{gh-pr}`1787`
402+
:::
403+
396404
Instructs gazelle to use these visibility labels on all _python_ targets
397405
(typically `py_*`, but can be modified via the `map_kind` directive). The arg
398406
to this directive is a comma-separated list (without spaces) of labels.
@@ -469,6 +477,10 @@ These special values can be useful for sub-packages.
469477
(directive-python-visibility)=
470478
## `python_visibility`
471479

480+
:::{versionadded} 0.32.0
481+
{gh-pr}`1784`
482+
:::
483+
472484
Appends additional `visibility` labels to each generated target.
473485

474486
This directive can be set multiple times. The generated `visibility` attribute
@@ -527,6 +539,10 @@ py_library(
527539
(directive-python-test-file-pattern)=
528540
## `python_test_file_pattern`
529541

542+
:::{versionadded} 0.32.0
543+
{gh-pr}`1819`
544+
:::
545+
530546
This directive adjusts which python files will be mapped to the {bzl:obj}`py_test` rule.
531547

532548
+ The default is `*_test.py,test_*.py`: both `test_*.py` and `*_test.py` files
@@ -590,6 +606,10 @@ py_library(
590606
(directive-python-label-convention)=
591607
## `python_label_convention`
592608

609+
:::{versionadded} 0.34.0
610+
{gh-pr}`1976`
611+
:::
612+
593613
:::{error}
594614
Detailed docs are not yet written.
595615
:::
@@ -598,6 +618,10 @@ Detailed docs are not yet written.
598618
(directive-python-label-normalization)=
599619
## `python_label_normalization`
600620

621+
:::{versionadded} 0.34.0
622+
{gh-pr}`1976`
623+
:::
624+
601625
:::{error}
602626
Detailed docs are not yet written.
603627
:::
@@ -653,6 +677,10 @@ that are relative to the current package.
653677
(directive-python-generate-pyi-deps)=
654678
## `python_generate_pyi_deps`
655679

680+
:::{versionadded} 1.6.0
681+
{gh-pr}`3014`
682+
:::
683+
656684
:::{error}
657685
Detailed docs are not yet written.
658686
:::
@@ -661,6 +689,10 @@ Detailed docs are not yet written.
661689
(directive-python-generate-pyi-srcs)=
662690
## `python_generate_pyi_srcs`
663691

692+
:::{versionadded} 1.6.0
693+
{gh-pr}`3356`
694+
:::
695+
664696
When `true`, include any sibling `.pyi` files in the `pyi_srcs` target attribute.
665697

666698
For example, assume you have the following files:
@@ -684,6 +716,10 @@ py_library(
684716
(directive-python-generate-proto)=
685717
## `python_generate_proto`
686718

719+
:::{versionadded} 1.6.0
720+
{gh-pr}`3057`
721+
:::
722+
687723
When `# gazelle:python_generate_proto true`, Gazelle will generate one
688724
{bzl:obj}`py_proto_library` for each `proto_library`, generating Python clients for
689725
protobuf in each package. By default this is turned off. Gazelle will also
@@ -746,13 +782,21 @@ previously-generated or hand-created rules.
746782
(directive-python-resolve-sibling-imports)=
747783
## `python_resolve_sibling_imports`
748784

785+
:::{versionadded} 1.6.0
786+
{gh-pr}`3106`
787+
:::
788+
749789
:::{error}
750790
Detailed docs are not yet written.
751791
:::
752792

753793
(directive-python-include-ancestor-conftest)=
754794
## `python_include_ancestor_conftest`
755795

796+
:::{versionadded} 1.9.0
797+
{gh-pr}`3596`
798+
:::
799+
756800
Version 1.9.0 includes a fix ({gh-pr}`3498`) for a long-standing issue
757801
({gh-issue}`3497`) where ancestor `conftest.py` files were not automatically
758802
added as dependencies of {bzl:obj}`py_test` targets.

0 commit comments

Comments
 (0)