Skip to content

Commit

Permalink
Update ruff's JSON schema (SchemaStore#3048)
Browse files Browse the repository at this point in the history
This updates ruff's JSON schema to [324455f580813a7c7721dc1d7ef1ee7721ae3e76](astral-sh/ruff@324455f)
  • Loading branch information
charliermarsh authored and Javier Matias-Cabrera committed Jul 19, 2023
1 parent bd14d19 commit 072ae50
Showing 1 changed file with 42 additions and 5 deletions.
47 changes: 42 additions & 5 deletions src/schemas/json/ruff.json
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,16 @@
},
"additionalProperties": false
},
"PyUpgradeOptions": {
"type": "object",
"properties": {
"keep-runtime-typing": {
"description": "Whether to avoid PEP 585 (`List[int]` -> `list[int]`) and PEP 604 (`Union[str, int]` -> `str | int`) rewrites even if a file imports `from __future__ import annotations`.\n\nThis setting is only applicable when the target Python version is below 3.9 and 3.10 respectively, and is most commonly used when working with libraries like Pydantic and FastAPI, which rely on the ability to parse type annotations at runtime. The use of `from __future__ import annotations` causes Python to treat the type annotations as strings, which typically allows for the use of language features that appear in later Python versions but are not yet supported by the current version (e.g., `str | int`). However, libraries that rely on runtime type annotations will break if the annotations are incompatible with the current Python version.\n\nFor example, while the following is valid Python 3.8 code due to the presence of `from __future__ import annotations`, the use of `str| int` prior to Python 3.10 will cause Pydantic to raise a `TypeError` at runtime:\n\n```python from __future__ import annotations\n\nimport pydantic\n\nclass Foo(pydantic.BaseModel): bar: str | int ```",
"type": ["boolean", "null"]
}
},
"additionalProperties": false
},
"Pycodestyle": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -744,14 +754,14 @@
"Quote": {
"oneOf": [
{
"description": "Use single quotes.",
"description": "Use double quotes.",
"type": "string",
"enum": ["single"]
"enum": ["double"]
},
{
"description": "Use double quotes.",
"description": "Use single quotes.",
"type": "string",
"enum": ["double"]
"enum": ["single"]
}
]
},
Expand Down Expand Up @@ -1216,6 +1226,7 @@
"NPY00",
"NPY001",
"NPY002",
"NPY003",
"PD",
"PD0",
"PD00",
Expand All @@ -1239,6 +1250,13 @@
"PERF10",
"PERF101",
"PERF102",
"PERF2",
"PERF20",
"PERF203",
"PERF4",
"PERF40",
"PERF401",
"PERF402",
"PGH",
"PGH0",
"PGH00",
Expand All @@ -1263,8 +1281,12 @@
"PL",
"PLC",
"PLC0",
"PLC01",
"PLC013",
"PLC0132",
"PLC02",
"PLC020",
"PLC0205",
"PLC0208",
"PLC04",
"PLC041",
Expand Down Expand Up @@ -1453,6 +1475,10 @@
"PYI0",
"PYI00",
"PYI001",
"PYI002",
"PYI003",
"PYI004",
"PYI005",
"PYI006",
"PYI007",
"PYI008",
Expand Down Expand Up @@ -1803,7 +1829,7 @@
"TabSize": {
"description": "The size of a tab.",
"type": "integer",
"format": "uint",
"format": "uint8",
"minimum": 0.0
},
"Version": {
Expand Down Expand Up @@ -2220,6 +2246,17 @@
}
]
},
"pyupgrade": {
"description": "Options for the `pyupgrade` plugin.",
"anyOf": [
{
"$ref": "#/definitions/PyUpgradeOptions"
},
{
"type": "null"
}
]
},
"required-version": {
"description": "Require a specific version of Ruff to be running (useful for unifying results across many environments, e.g., with a `pyproject.toml` file).",
"anyOf": [
Expand Down

0 comments on commit 072ae50

Please sign in to comment.