Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Linting Workflow #52

Merged
merged 5 commits into from
Dec 29, 2024
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
61 changes: 40 additions & 21 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
toreamun marked this conversation as resolved.
Show resolved Hide resolved

- 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 .
1 change: 1 addition & 0 deletions custom_components/victorsmartkill/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for victorsmartkill."""

from __future__ import annotations

# Base component constants
Expand Down
1 change: 1 addition & 0 deletions custom_components/victorsmartkill/entity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""VictorSmartKillEntity class."""

from __future__ import annotations

from abc import ABC, abstractmethod
Expand Down
1 change: 1 addition & 0 deletions custom_components/victorsmartkill/system_health.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Provide info to system health."""

from __future__ import annotations

from typing import Any
Expand Down
Loading