From c2c62bb8753653a6887c4af5211df68672662536 Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Sun, 9 Mar 2025 17:07:06 +0000 Subject: [PATCH] Add pre-commit --- .pre-commit-config.yaml | 10 ++++++++++ requirements.txt | 1 + scripts/setup | 2 ++ 3 files changed, 13 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..ffae41e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.9.10 + hooks: + # Run the linter. + - id: ruff + args: [--fix] + # Run the formatter. + - id: ruff-format diff --git a/requirements.txt b/requirements.txt index f41a016..3725fe7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,4 +10,5 @@ cryptography # should already be installed with Home Assistant # Development colorlog pip>=21.0 +pre-commit ruff \ No newline at end of file diff --git a/scripts/setup b/scripts/setup index 3b556ee..fce65b1 100755 --- a/scripts/setup +++ b/scripts/setup @@ -8,4 +8,6 @@ cd "$(dirname "$0")/.." python3 -m pip install --requirement requirements.txt --upgrade +pre-commit install + mkdir -p config \ No newline at end of file