From e041c9a2b033c89e60b12baff7316b800dd2f8f0 Mon Sep 17 00:00:00 2001 From: Hudson Brendon Date: Tue, 7 Jan 2025 08:17:33 -0300 Subject: [PATCH] feat: add pre-commit in project --- .devcontainer/Dockerfile | 18 +++++++++++++++++- .pre-commit-config.yaml | 27 +++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .pre-commit-config.yaml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 7810f84..34ebb24 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -6,7 +6,23 @@ RUN apt-get update \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN python -m pip install --upgrade homeassistant colorlog black pylint numpy hassil av go2rtc-client zeroconf async-upnp-client pyserial aiodhcpwatcher PyTurboJPEG homeassistant-frontend aiodiscover ha-ffmpeg home-assistant-intents mutagen +RUN python -m pip install --upgrade \ + homeassistant \ + colorlog \ + ruff \ + numpy \ + hassil \ + av \ + go2rtc-client \ + zeroconf \ + async-upnp-client \ + pyserial \ + aiodhcpwatcher \ + PyTurboJPEG \ + aiodiscover \ + ha-ffmpeg \ + home-assistant-intents \ + mutagen RUN cd && mkdir -p /config/custom_components diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..016389d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,27 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +default_language_version: + python: python3.13 +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-toml + - id: check-yaml + - id: check-xml + - id: check-json + - id: check-added-large-files + - id: end-of-file-fixer + - id: trailing-whitespace + - id: debug-statements + - id: mixed-line-ending + - id: detect-private-key + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/charliermarsh/ruff-pre-commit + rev: v0.1.2 + hooks: + - id: ruff + args: + - --fix + - id: ruff-format