Skip to content

Commit

Permalink
Fixed code and doc strings styles
Browse files Browse the repository at this point in the history
  • Loading branch information
max-pfeiffer committed Jan 26, 2024
1 parent 66fc396 commit aacafbb
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ repos:
rev: v0.1.14
hooks:
- id: ruff
args: ["backend"]
args: ["--config", "backend/pyproject.toml", "backend"]
2 changes: 1 addition & 1 deletion backend/app/adapters/gpio_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Relay(DigitalOutputDevice):
"""Relay which is triggered by GPIO pins."""

def __init__(self, pin: Union[int, str]):
"""Initializer.
"""Initialize object.
:param Union[int, str] pin:
"""
Expand Down
6 changes: 3 additions & 3 deletions backend/app/adapters/waveshare.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class WaveshareRpiRelayBoardAdapter:
}

def __init__(self, relays: Optional[list[Relay]] = None):
"""Initializer.
"""Initialize object.
:param list[Relay] relays:
"""
Expand All @@ -29,7 +29,7 @@ def __init__(self, relays: Optional[list[Relay]] = None):
self.relays: list[Relay] = relays

def on(self, relay_position: int):
"""Turns relay at relay_position on.
"""Turn on relay at relay_position.
:param int relay_position:
:return:
Expand All @@ -41,7 +41,7 @@ def on(self, relay_position: int):
relay.on()

def off(self, relay_position: int):
"""Turns relay at relay_position off.
"""Turn off relay at relay_position.
:param int relay_position:
:return:
Expand Down
2 changes: 1 addition & 1 deletion backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ select = [
]

[tool.ruff.lint.pydocstyle]
convention = "google"
convention = "pep257"

# https://docs.pytest.org/en/latest/reference/customize.html
[tool.pytest.ini_options]
Expand Down
2 changes: 1 addition & 1 deletion backend/tests/fake_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class FakeRelay:
"""Class for faking a relay."""

def __init__(self):
"""Initializer."""
"""Initialize object."""
self._value: int = None

def on(self) -> None:
Expand Down
1 change: 1 addition & 0 deletions backend/tests/unit/test_relay_services.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Tests for services."""
from app.adapters.waveshare import WaveshareRpiRelayBoardAdapter
from app.services import switch_relay_off, switch_relay_on

from tests.fake_objects import FakeRelay


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests for the Waveshare board adapter."""
import pytest

from app.adapters.waveshare import WaveshareRpiRelayBoardAdapter

from tests.fake_objects import FakeRelay


Expand Down

0 comments on commit aacafbb

Please sign in to comment.