Skip to content

Commit ff6a4c1

Browse files
authored
Replace black and isort with ruff (#924)
* Replace black and isort with ruff * Restore pre-commit
1 parent b2220af commit ff6a4c1

File tree

5 files changed

+66
-112
lines changed

5 files changed

+66
-112
lines changed

.pre-commit-config.yaml

+3-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,9 @@ repos:
99
- id: trailing-whitespace
1010
- repo: local
1111
hooks:
12-
- id: black
13-
name: black
14-
entry: poetry run black
15-
language: system
16-
types: [python]
17-
require_serial: true
18-
- id: isort
19-
name: isort
20-
entry: poetry run isort
12+
- id: ruff-format
13+
name: ruff format
14+
entry: poetry run ruff format
2115
language: system
2216
types: [python]
2317
require_serial: true

custom_components/google_home/config_flow.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def is_matching(self, other_flow: Self) -> bool:
4747
return other_flow.username == self.username
4848

4949
async def async_step_user(
50-
self, user_input: ConfigFlowDict | None = None # type: ignore[override]
50+
self,
51+
user_input: ConfigFlowDict | None = None, # type: ignore[override]
5152
) -> ConfigFlowResult:
5253
"""Handle a flow initialized by the user."""
5354
self._errors = {}

poetry.lock

+50-95
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+10-7
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@ glocaltokens = "^0.7.3"
1717
homeassistant = "2024.11.0b0"
1818

1919
[tool.poetry.group.dev.dependencies]
20-
black = "^24.10.0"
2120
codespell = "^2.3.0"
2221
flake8 = "^7.1.1"
2322
flake8-bugbear = "^24.10.31"
2423
flake8-comprehensions = "^3.16.0"
2524
flake8-simplify = "^0.21.0"
2625
flake8-use-fstring = "^1.4"
2726
homeassistant-stubs = "^2024.11.0b0"
28-
isort = "^5.13.2"
2927
mypy = "^1.13"
3028
pre-commit = "^4.0.1"
3129
PyGithub = "^2.4"
3230
pylint = "^3.3.1"
31+
ruff = "^0.7.2"
3332
types-requests = "<2.31.0.7"
3433
voluptuous-stubs = "^0.1.1"
3534

@@ -51,11 +50,15 @@ disable = [
5150
[tool.pylint.format]
5251
max-line-length = 88
5352

54-
[tool.isort]
55-
profile = "black"
56-
force_sort_within_sections = true
57-
combine_as_imports = true
58-
known_first_party = [
53+
[tool.ruff]
54+
required-version = ">=0.7.0"
55+
target-version = "py312"
56+
57+
[tool.ruff.lint.isort]
58+
force-sort-within-sections = true
59+
combine-as-imports = true
60+
split-on-trailing-comma = false
61+
known-first-party = [
5962
"homeassistant",
6063
]
6164

script/publish_release.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#!/usr/bin/env python3
22
"""Update manifest.json and create new Github Release."""
3+
34
from __future__ import annotations
45

56
from importlib.metadata import version as package_version

0 commit comments

Comments
 (0)