Skip to content

Commit

Permalink
Use ruff for linting and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Nov 30, 2023
1 parent caaee69 commit 42c18c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
22 changes: 7 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -9,24 +9,16 @@ repos:
- id: debug-statements
- id: check-ast

- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8

- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: isort
additional_dependencies: [toml]
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.0.1
rev: v1.7.1
hooks:
- id: mypy
additional_dependencies: [types-attrs]
6 changes: 3 additions & 3 deletions custom_components/upnp_availability/upnpstatustracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class Device:

max_age = attr.ib(default=1800)

info = attr.ib(factory=dict)
icons = attr.ib(factory=list, repr=False)
info: Dict[str, str] = attr.ib(factory=dict)
icons: List[Icon] = attr.ib(factory=list, repr=False)

expire_timer = attr.ib(default=None, repr=False)
expire_callback = attr.ib(default=None, repr=False)
Expand Down Expand Up @@ -144,7 +144,7 @@ def __init__(
new_device_cb=None,
state_changed_cb=None,
max_age_override=None,
source_addresses=None
source_addresses=None,
):
"""Creates a status tracker.
Expand Down

0 comments on commit 42c18c3

Please sign in to comment.