Skip to content
Open
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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 # v5.3.1
- name: Cache pre-commit
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
- name: Cache prek
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-|${{ hashFiles('.pre-commit-config.yaml') }}
path: ~/.cache/prek
key: prek-|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Lint
run: |
uv run pre-commit run --all-files
uv run prek run --all-files
env:
SKIP: no-commit-to-branch
- name: Lint GitHub Actions
Expand Down
89 changes: 12 additions & 77 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ repos:
hooks:
- id: shellcheck
name: ✅ Check Shell files
- repo: builtin
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-toml
- id: check-merge-conflict
- id: detect-private-key
- id: check-executables-have-shebangs
stages: [pre-commit, pre-push, manual]
- id: check-symlinks
- repo: local
hooks:
- id: ruff
Expand All @@ -24,56 +36,6 @@ repos:
language: system
entry: uv run ruff check
args: [--fix, --exit-non-zero-on-fix]
- id: check-ast
name: 🐍 Check Python AST
language: system
types: [python]
entry: uv run check-ast
- id: check-case-conflict
name: 🔠 Check for case conflicts
language: system
entry: uv run check-case-conflict
- id: check-docstring-first
name: ℹ️ Check docstring is first
language: system
types: [python]
entry: uv run check-docstring-first
- id: check-executables-have-shebangs
name: 🧐 Check that executables have shebangs
language: system
types: [text, executable]
entry: uv run check-executables-have-shebangs
stages: [pre-commit, pre-push, manual]
- id: check-json
name: { Check JSON files
language: system
types: [json]
entry: uv run check-json
- id: check-merge-conflict
name: 💥 Check for merge conflicts
language: system
types: [text]
entry: uv run check-merge-conflict
- id: check-symlinks
name: 🔗 Check for broken symlinks
language: system
types: [symlink]
entry: uv run check-symlinks
- id: check-toml
name: ✅ Check TOML files
language: system
types: [toml]
entry: uv run check-toml
- id: check-xml
name: ✅ Check XML files
entry: uv run check-xml
language: system
types: [xml]
- id: check-yaml
name: ✅ Check YAML files
language: system
types: [yaml]
entry: uv run check-yaml
- id: codespell
name: ✅ Check code for common misspellings
language: system
Expand All @@ -83,27 +45,6 @@ repos:
.lock
)$
entry: uv run codespell --ignore-words=.codespell
- id: debug-statements
name: 🪵 Debug Statements and imports (Python)
language: system
types: [python]
entry: uv run debug-statement-hook
- id: detect-private-key
name: 🕵️ Detect Private Keys
language: system
types: [text]
entry: uv run detect-private-key
- id: end-of-file-fixer
name: ⮐ Fix End of Files
language: system
types: [text]
entry: uv run end-of-file-fixer
stages: [pre-commit, pre-push, manual]
- id: fix-byte-order-marker
name: 🚏 Fix UTF-8 byte order marker
language: system
types: [text]
entry: uv run fix-byte-order-marker
- id: mypy
name: 🆎 Static type checking using mypy
language: system
Expand All @@ -116,12 +57,6 @@ repos:
types: [python]
entry: uv run pytest
pass_filenames: false
- id: trailing-whitespace
name: ✄ Trim Trailing Whitespace
language: system
types: [text]
entry: uv run trailing-whitespace-fixer
stages: [pre-commit, pre-push, manual]
- id: yamllint
name: 🎗 Check YAML files with yamllint
language: system
Expand Down
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ packages = ["custom_components/weenect"]
dev = [
"codespell>=2.3.0",
"mypy>=1.15.0",
"pre-commit>=4.1.0",
"prek>=0.3.0",
"yamllint>=1.35.1",
"ruff>=0.9.9",
"pre-commit-hooks>=5.0.0",
"pytest-homeassistant-custom-component>=0.13.195",
]

Expand Down
Loading