diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 8d6edc5..3925bf5 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -16,3 +16,19 @@ jobs: uses: "hacs/action@main" with: category: "integration" + + # Separate job so a lint failure is distinguishable from HACS validation + # failing. Runs the tracked ruff.toml; formatting is deliberately not + # checked here, the repository has not been reformatted. + lint: + name: "Ruff" + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v3" + - uses: "actions/setup-python@v5" + with: + python-version: "3.13" + - name: Install ruff + run: pip install ruff==0.16.0 + - name: Ruff check + run: ruff check . diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..9a64c2f --- /dev/null +++ b/pytest.ini @@ -0,0 +1,15 @@ +# Pytest configuration for the sws12500 Home Assistant custom component. +# +# The suite is written against these settings; without them a clean clone +# collects the async tests but never awaits them. Kept as a standalone +# pytest.ini for the same reason the ruff config lives in ruff.toml: one +# tool, one tracked file, no package metadata this repository does not need. + +[pytest] +testpaths = tests + +# Most async tests carry no @pytest.mark.asyncio marker, so pytest-asyncio's +# default strict mode would skip awaiting them. Auto mode treats every async +# test function as an asyncio test. +asyncio_mode = auto +asyncio_default_fixture_loop_scope = function