From 889a698467318648fab8c2c85606de101291440e Mon Sep 17 00:00:00 2001 From: Glenn de Haan Date: Tue, 27 Jan 2026 20:07:15 +0100 Subject: [PATCH] Add pylint testing --- .github/workflows/linting.yml | 21 +++++++++++++++++++++ pyproject.toml | 6 ++++++ src/hdfury/api.py | 3 ++- 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 0f3ce99..f0f936f 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 1f6ba25..c8a5249 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/hdfury/api.py b/src/hdfury/api.py index 7b7670f..9ccbe92 100644 --- a/src/hdfury/api.py +++ b/src/hdfury/api.py @@ -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}")