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

chore: switch to ruff #54

Merged
merged 2 commits into from
Dec 11, 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
25 changes: 16 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,7 @@ repos:
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
args: [--py39-plus]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
Expand All @@ -64,3 +56,18 @@ repos:
hooks:
- id: bandit
args: [-x, tests]
- repo: https://github.com/python-poetry/poetry
rev: 1.8.0
hooks:
- id: poetry-check
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
args: ["--tab-width", "2"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
from typing import Any, List
from typing import Any

# -- Project information -----------------------------------------------------

Expand All @@ -40,7 +40,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns: List[Any] = []
exclude_patterns: list[Any] = []


# -- Options for HTML output -------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/led_ble/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# "ffd4" - Triones:B30200000459C - legacy


STATE_COMMAND = b"\xEF\x01\x77"
STATE_COMMAND = b"\xef\x01\x77"


class CharacteristicMissingError(Exception):
Expand Down
1 change: 0 additions & 1 deletion src/led_ble/model_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

@dataclass(frozen=True)
class LEDBLEModel:

model_num: int # The model number aka byte 1
models: list[str] # The model names from discovery
description: str # Description of the model ({type} {color_mode})
Expand Down
1 change: 0 additions & 1 deletion src/led_ble/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

@dataclass(frozen=True)
class LEDBLEState:

power: bool = False
rgb: tuple[int, int, int] = (0, 0, 0)
w: int = 0
Expand Down
Loading