mirror of https://github.com/tiangolo/fastapi.git
add FURB ruff rule
This commit is contained in:
parent
c48539f4c6
commit
425e4f5cea
|
|
@ -438,9 +438,7 @@ def get_request_handler(
|
|||
}
|
||||
# If status_code was set, use it, otherwise use the default from the
|
||||
# response class, in the case of redirect it's 307
|
||||
current_status_code = (
|
||||
status_code if status_code else solved_result.response.status_code
|
||||
)
|
||||
current_status_code = status_code or solved_result.response.status_code
|
||||
if current_status_code is not None:
|
||||
response_args["status_code"] = current_status_code
|
||||
if solved_result.response.status_code:
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ docs = [
|
|||
]
|
||||
docs-tests = [
|
||||
"httpx >=0.23.0,<1.0.0",
|
||||
"ruff >=0.14.14",
|
||||
"ruff >=0.15.0",
|
||||
]
|
||||
github-actions = [
|
||||
"httpx >=0.27.0,<1.0.0",
|
||||
|
|
@ -288,13 +288,14 @@ show_contexts = true
|
|||
|
||||
[tool.ruff.lint]
|
||||
select = [
|
||||
"E", # pycodestyle errors
|
||||
"W", # pycodestyle warnings
|
||||
"F", # pyflakes
|
||||
"I", # isort
|
||||
"B", # flake8-bugbear
|
||||
"C4", # flake8-comprehensions
|
||||
"UP", # pyupgrade
|
||||
"E", # pycodestyle errors
|
||||
"W", # pycodestyle warnings
|
||||
"F", # pyflakes
|
||||
"I", # isort
|
||||
"B", # flake8-bugbear
|
||||
"C4", # flake8-comprehensions
|
||||
"UP", # pyupgrade
|
||||
"FURB" # refurb
|
||||
]
|
||||
ignore = [
|
||||
"E501", # line too long, handled by black
|
||||
|
|
|
|||
|
|
@ -594,7 +594,7 @@ def replace_multiline_code_block(
|
|||
)
|
||||
|
||||
block_language = block_a["lang"].lower()
|
||||
if block_language in {"mermaid"}:
|
||||
if block_language == "mermaid":
|
||||
if block_a != block_b:
|
||||
print(
|
||||
f"Skipping mermaid code block replacement (lines {start_line}-{end_line_no}). "
|
||||
|
|
|
|||
8
uv.lock
8
uv.lock
|
|
@ -1587,7 +1587,7 @@ dev = [
|
|||
{ name = "pytest-codspeed", specifier = ">=4.2.0" },
|
||||
{ name = "python-slugify", specifier = ">=8.0.4" },
|
||||
{ name = "pyyaml", specifier = ">=5.3.1,<7.0.0" },
|
||||
{ name = "ruff", specifier = ">=0.14.14" },
|
||||
{ name = "ruff", specifier = ">=0.15.0" },
|
||||
{ name = "sqlmodel", specifier = ">=0.0.31" },
|
||||
{ name = "strawberry-graphql", specifier = ">=0.200.0,<1.0.0" },
|
||||
{ name = "typer", specifier = ">=0.21.1" },
|
||||
|
|
@ -1610,12 +1610,12 @@ docs = [
|
|||
{ name = "pillow", specifier = ">=11.3.0" },
|
||||
{ name = "python-slugify", specifier = ">=8.0.4" },
|
||||
{ name = "pyyaml", specifier = ">=5.3.1,<7.0.0" },
|
||||
{ name = "ruff", specifier = ">=0.14.14" },
|
||||
{ name = "ruff", specifier = ">=0.15.0" },
|
||||
{ name = "typer", specifier = ">=0.21.1" },
|
||||
]
|
||||
docs-tests = [
|
||||
{ name = "httpx", specifier = ">=0.23.0,<1.0.0" },
|
||||
{ name = "ruff", specifier = ">=0.14.14" },
|
||||
{ name = "ruff", specifier = ">=0.15.0" },
|
||||
]
|
||||
github-actions = [
|
||||
{ name = "httpx", specifier = ">=0.27.0,<1.0.0" },
|
||||
|
|
@ -1639,7 +1639,7 @@ tests = [
|
|||
{ name = "pytest", specifier = ">=7.1.3,<9.0.0" },
|
||||
{ name = "pytest-codspeed", specifier = ">=4.2.0" },
|
||||
{ name = "pyyaml", specifier = ">=5.3.1,<7.0.0" },
|
||||
{ name = "ruff", specifier = ">=0.14.14" },
|
||||
{ name = "ruff", specifier = ">=0.15.0" },
|
||||
{ name = "sqlmodel", specifier = ">=0.0.31" },
|
||||
{ name = "strawberry-graphql", specifier = ">=0.200.0,<1.0.0" },
|
||||
{ name = "types-orjson", specifier = ">=3.6.2" },
|
||||
|
|
|
|||
Loading…
Reference in New Issue