mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
Workaround Even Better TOML crash related to allOf (#15992)
## Summary Fixes https://github.com/astral-sh/ruff/issues/15978 Even Better TOML doesn't support `allOf` well. In fact, it just crashes. This PR works around this limitation by avoid using `allOf` in the automatically derived schema for the docstring formatting setting. ### Alternatives schemars introduces `allOf` whenver it sees a `$ref` alongside other object properties because this is no longer valid according to Draft 7. We could replace the visitor performing the rewrite but I prefer not to because replacing `allOf` with `oneOf` is only valid for objects that don't have any other `oneOf` or `anyOf` schema. ## Test Plan https://github.com/user-attachments/assets/25d73b2a-fee1-4ba6-9ffe-869b2c3bc64e
This commit is contained in:
12
ruff.schema.json
generated
12
ruff.schema.json
generated
@@ -879,7 +879,7 @@
|
||||
"anyOf": [
|
||||
{
|
||||
"description": "Wrap docstring code examples at a fixed line width.",
|
||||
"allOf": [
|
||||
"oneOf": [
|
||||
{
|
||||
"$ref": "#/definitions/LineWidth"
|
||||
}
|
||||
@@ -887,18 +887,10 @@
|
||||
},
|
||||
{
|
||||
"description": "Respect the line length limit setting for the surrounding Python code.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/Dynamic"
|
||||
}
|
||||
]
|
||||
"const": "dynamic"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Dynamic": {
|
||||
"type": "string",
|
||||
"const": "dynamic"
|
||||
},
|
||||
"Flake8AnnotationsOptions": {
|
||||
"description": "Options for the `flake8-annotations` plugin.",
|
||||
"type": "object",
|
||||
|
||||
Reference in New Issue
Block a user