mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 09:47:52 +00:00
Bump ruff to 0.5.2 (#121946)
This commit is contained in:
parent
6109b9206c
commit
3b95e88ff7
@ -1,6 +1,6 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
rev: v0.5.1
|
rev: v0.5.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args:
|
args:
|
||||||
|
@ -693,7 +693,7 @@ exclude_lines = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
required-version = ">=0.5.0"
|
required-version = ">=0.5.2"
|
||||||
|
|
||||||
[tool.ruff.lint]
|
[tool.ruff.lint]
|
||||||
select = [
|
select = [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
|
# Automatically generated from .pre-commit-config.yaml by gen_requirements_all.py, do not edit
|
||||||
|
|
||||||
codespell==2.3.0
|
codespell==2.3.0
|
||||||
ruff==0.5.1
|
ruff==0.5.2
|
||||||
yamllint==1.35.1
|
yamllint==1.35.1
|
||||||
|
@ -21,7 +21,7 @@ def _has_assignment(module: ast.Module, name: str) -> bool:
|
|||||||
for item in module.body:
|
for item in module.body:
|
||||||
if type(item) not in (ast.Assign, ast.AnnAssign, ast.AugAssign):
|
if type(item) not in (ast.Assign, ast.AnnAssign, ast.AugAssign):
|
||||||
continue
|
continue
|
||||||
if type(item) == ast.Assign:
|
if type(item) is ast.Assign:
|
||||||
for target in item.targets:
|
for target in item.targets:
|
||||||
if getattr(target, "id", None) == name:
|
if getattr(target, "id", None) == name:
|
||||||
return True
|
return True
|
||||||
@ -35,7 +35,7 @@ def _has_function(
|
|||||||
module: ast.Module, _type: ast.AsyncFunctionDef | ast.FunctionDef, name: str
|
module: ast.Module, _type: ast.AsyncFunctionDef | ast.FunctionDef, name: str
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Test if the module defines a function."""
|
"""Test if the module defines a function."""
|
||||||
return any(type(item) == _type and item.name == name for item in module.body)
|
return any(type(item) is _type and item.name == name for item in module.body)
|
||||||
|
|
||||||
|
|
||||||
def _has_import(module: ast.Module, name: str) -> bool:
|
def _has_import(module: ast.Module, name: str) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user