Skip to content
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
21 changes: 21 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,24 @@ jobs:

- name: Run ruff
run: ruff check src

pylint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pylint

- name: Run pylint
run: pylint src
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ ignore = [
]
extend-ignore = []

[tool.pylint."MESSAGES CONTROL"]
disable = [
"redefined-builtin",
"too-many-public-methods",
]

[tool.mypy]
python_version = 3.11
files = "src,hdfury"
Expand Down
3 changes: 2 additions & 1 deletion src/hdfury/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def _normalize_state(state: str, output: Literal["text", "number"] = "text") ->

if state in ("1", "on"):
return "on" if output == "text" else "1"
elif state in ("0", "off"):

if state in ("0", "off"):
return "off" if output == "text" else "0"

raise HDFuryParseError(f"Invalid state: {state}")
Expand Down