Skip to content

Commit

Permalink
Replace black with ruff (#1139)
Browse files Browse the repository at this point in the history
* Replace black with ruff

* Updates
  • Loading branch information
epenet authored Apr 16, 2024
1 parent ee1488f commit 5bc7139
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
repos:
- repo: local
hooks:
- id: black
name: black
entry: black
language: system
types: [python]
require_serial: true
- id: check-added-large-files
name: Check for added large files
entry: check-added-large-files
Expand All @@ -27,12 +21,18 @@ repos:
language: system
types: [text]
stages: [commit, push, manual]
- id: ruff
name: ruff
- id: ruff-check
name: Lint code with Ruff
entry: ruff check
language: system
types: [python]
require_serial: true
- id: ruff-format
name: Format code with Ruff
entry: ruff format
language: system
types: [python]
require_serial: true
- id: trailing-whitespace
name: Trim Trailing Whitespace
entry: trailing-whitespace-fixer
Expand Down
1 change: 0 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ def precommit(session: Session) -> None:
"""Lint using pre-commit."""
args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"]
session.install(
"black",
"darglint",
"ruff",
"pre-commit",
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ sphinx = ">=4.3.2,<8.0.0"
sphinx-autobuild = "^2021.3.14"
pre-commit = ">=2.21,<4.0"
ruff = ">=0.3.7"
black = ">=22.12,<25.0"
darglint = "^1.8.1"
pre-commit-hooks = ">=4.4,<6.0"
sphinx-rtd-theme = ">=1.2,<3.0"
Expand Down
4 changes: 1 addition & 3 deletions src/renault_api/kamereon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ async def request(
# Some endpoints return arrays instead of objects.
# These need to be wrapped in an object.
if response_text.startswith("["):
response_text = (
f'{{"{wrap_array_in or "data"}": {response_text}}}' # noqa: B907
)
response_text = f'{{"{wrap_array_in or "data"}": {response_text}}}' # noqa: B907
if not response_text.startswith("{"):
# Check for HTTP error
http_response.raise_for_status()
Expand Down
2 changes: 1 addition & 1 deletion src/renault_api/kamereon/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def update_schedule(schedule: models.ChargeSchedule, settings: Dict[str, Any]) -


def create_schedule(
settings: Dict[str, Any]
settings: Dict[str, Any],
) -> models.ChargeSchedule: # pragma: no cover
"""Update schedule."""
raise NotImplementedError
Expand Down

0 comments on commit 5bc7139

Please sign in to comment.