diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 639cdc7..7f21867 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -8,25 +8,44 @@ on: branches: - "master" +permissions: + contents: read + jobs: - ruff: - name: "Ruff" - runs-on: "ubuntu-latest" - steps: - - name: "Checkout the repository" - uses: "actions/checkout@v4.1.7" - - - name: "Set up Python" - uses: actions/setup-python@v5.1.0 - with: - python-version: "3.12" - cache: "pip" - - - name: "Install requirements" - run: python3 -m pip install -r requirements.txt - - - name: "Lint" - run: python3 -m ruff check . - - - name: "Format" - run: python3 -m ruff format . --check + ruff-format: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set up Python 3.12 + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + with: + python-version: "3.12" + cache: "pip" + + - name: "Install requirements" + run: python3 -m pip install -r requirements.txt + + - name: Run ruff format + run: | + ruff format --diff --target-version=py312 . + + ruff: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set up Python 3.12 + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + with: + python-version: "3.12" + cache: "pip" + + - name: "Install requirements" + run: python3 -m pip install -r requirements.txt + + - name: Run ruff + run: | + ruff check --output-format=github . diff --git a/custom_components/victorsmartkill/const.py b/custom_components/victorsmartkill/const.py index abaea8b..29d4c9e 100644 --- a/custom_components/victorsmartkill/const.py +++ b/custom_components/victorsmartkill/const.py @@ -1,4 +1,5 @@ """Constants for victorsmartkill.""" + from __future__ import annotations # Base component constants diff --git a/custom_components/victorsmartkill/entity.py b/custom_components/victorsmartkill/entity.py index 8733619..fe762fb 100644 --- a/custom_components/victorsmartkill/entity.py +++ b/custom_components/victorsmartkill/entity.py @@ -1,4 +1,5 @@ """VictorSmartKillEntity class.""" + from __future__ import annotations from abc import ABC, abstractmethod diff --git a/custom_components/victorsmartkill/system_health.py b/custom_components/victorsmartkill/system_health.py index 8da6ea8..fb8f41e 100644 --- a/custom_components/victorsmartkill/system_health.py +++ b/custom_components/victorsmartkill/system_health.py @@ -1,4 +1,5 @@ """Provide info to system health.""" + from __future__ import annotations from typing import Any