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