Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace black and isort with ruff #924

Merged
merged 2 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ repos:
- id: trailing-whitespace
- repo: local
hooks:
- id: black
name: black
entry: poetry run black
language: system
types: [python]
require_serial: true
- id: isort
name: isort
entry: poetry run isort
- id: ruff-format
name: ruff format
entry: poetry run ruff format
language: system
types: [python]
require_serial: true
Expand Down
3 changes: 2 additions & 1 deletion custom_components/google_home/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def is_matching(self, other_flow: Self) -> bool:
return other_flow.username == self.username

async def async_step_user(
self, user_input: ConfigFlowDict | None = None # type: ignore[override]
self,
user_input: ConfigFlowDict | None = None, # type: ignore[override]
) -> ConfigFlowResult:
"""Handle a flow initialized by the user."""
self._errors = {}
Expand Down
145 changes: 50 additions & 95 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,18 @@ glocaltokens = "^0.7.3"
homeassistant = "2024.11.0b0"

[tool.poetry.group.dev.dependencies]
black = "^24.10.0"
codespell = "^2.3.0"
flake8 = "^7.1.1"
flake8-bugbear = "^24.10.31"
flake8-comprehensions = "^3.16.0"
flake8-simplify = "^0.21.0"
flake8-use-fstring = "^1.4"
homeassistant-stubs = "^2024.11.0b0"
isort = "^5.13.2"
mypy = "^1.13"
pre-commit = "^4.0.1"
PyGithub = "^2.4"
pylint = "^3.3.1"
ruff = "^0.7.2"
types-requests = "<2.31.0.7"
voluptuous-stubs = "^0.1.1"

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

[tool.isort]
profile = "black"
force_sort_within_sections = true
combine_as_imports = true
known_first_party = [
[tool.ruff]
required-version = ">=0.7.0"
target-version = "py312"

[tool.ruff.lint.isort]
force-sort-within-sections = true
combine-as-imports = true
split-on-trailing-comma = false
known-first-party = [
"homeassistant",
]

Expand Down
1 change: 1 addition & 0 deletions script/publish_release.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
"""Update manifest.json and create new Github Release."""

from __future__ import annotations

from importlib.metadata import version as package_version
Expand Down