mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-21 15:52:34 +00:00
Use stripping block (|-
) for page descriptions (#14980)
## Summary Resolves #14976. Currently, we uses this "[plain scalar](https://yaml.org/spec/1.2.2/#733-plain-style)" format: ```yaml description: Checks for `if key in dictionary: del dictionary[key]`. ``` Plain scalar must not contain the sequence `: `, however, so the above is invalid. This PR changes that to: ```yaml description: |- Checks for `if key in dictionary: del dictionary[key]`. ``` `|` denotes a "[block scalar](https://yaml.org/spec/1.2.2/#81-block-scalar-styles)", whereas [the `-` chomping indicator](https://yaml.org/spec/1.2.2/#8112-block-chomping-indicator) requires that a trailing newline, if any, must be stripped. ## Test Plan 
This commit is contained in:
parent
4a7536dc94
commit
7173e6a20b
1 changed files with 2 additions and 1 deletions
|
@ -157,7 +157,8 @@ def generate_rule_metadata(rule_doc: Path) -> None:
|
|||
"\n".join(
|
||||
[
|
||||
"---",
|
||||
f"description: {description}",
|
||||
"description: |-",
|
||||
f" {description}",
|
||||
"tags:",
|
||||
f"- {rule_code}",
|
||||
"---",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue