Skip to content

Commit 52712b9

Browse files
authored
fix(gazelle): Include YAML 'docstart' in gazelle manifest file (#2656)
Update `gazelle_python.yaml` to include the YAML docstart string: ```diff -- a/gazelle_python.yaml +++ b/gazelle_python.yaml @@ -3,6 +3,7 @@ # To update this file, run: # bazel run //:gazelle_python_manifest.update +--- manifest: modules_mapping: 30fcd23745efe32ce681__mypyc: black ``` While _technically_ not required, it is good practice to include. And then users don't have to exclude `gazelle_python.yaml` from their linters 🙃. /cc @joshgc
1 parent e7d2f09 commit 52712b9

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@ Unreleased changes template.
5555
* (deps) platforms 0.0.4 -> 0.0.11
5656
* (py_wheel) Package `py_library.pyi_srcs` (`.pyi` files) in the wheel.
5757
* (py_package) Package `py_library.pyi_srcs` (`.pyi` files) in `py_package`.
58+
* (gazelle) The generated manifest file (default: `gazelle_python.yaml`) will now include the
59+
YAML document start `---` line. Implemented in
60+
[#2656](https://github.com/bazelbuild/rules_python/pull/2656).
5861

5962
{#v0-0-0-fixed}
6063
### Fixed
6164
* (pypi) The `ppc64le` is now pointing to the right target in the `platforms` package.
62-
* (gazelle) No longer incorrectly merge `py_binary` targets during partial updates in
65+
* (gazelle) No longer incorrectly merge `py_binary` targets during partial updates in
6366
`file` generation mode. Fixed in [#2619](https://github.com/bazelbuild/rules_python/pull/2619).
6467
* (bzlmod) Running as root is no longer an error. `ignore_root_user_error=True`
6568
is now the default. Note that running as root may still cause spurious

examples/build_file_generation/gazelle_python.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# To update this file, run:
44
# bazel run //:gazelle_python_manifest.update
55

6+
---
67
manifest:
78
modules_mapping:
89
alabaster: alabaster

examples/bzlmod_build_file_generation/gazelle_python.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# To update this file, run:
44
# bazel run //:gazelle_python_manifest.update
55

6+
---
67
manifest:
78
modules_mapping:
89
S3: s3cmd

examples/bzlmod_build_file_generation/gazelle_python_with_types.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# To update this file, run:
44
# bazel run //:gazelle_python_manifest_with_types.update
55

6+
---
67
manifest:
78
modules_mapping:
89
S3: s3cmd

gazelle/manifest/generate/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func writeOutput(
151151
}
152152
defer outputFile.Close()
153153

154-
if _, err := fmt.Fprintf(outputFile, "%s\n", header); err != nil {
154+
if _, err := fmt.Fprintf(outputFile, "%s\n---\n", header); err != nil {
155155
return fmt.Errorf("failed to write output: %w", err)
156156
}
157157

0 commit comments

Comments
 (0)