From 2901dd93c582bcac88f612127148a498ed5f117e Mon Sep 17 00:00:00 2001 From: Manuel Raimann Date: Fri, 18 Oct 2024 18:51:11 +0200 Subject: [PATCH] Add Python pre-commit hooks --- .pre-commit-config.yaml | 20 ++++++++++++++++++++ spectator/client/gen-compose.py | 3 ++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index da1b534..233e2f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,6 +19,24 @@ repos: hooks: - id: sqlfluff-fix args: ["--dialect", "clickhouse", "-e", "CP03,CP05"] +- repo: https://github.com/asottile/pyupgrade + rev: v3.17.0 + hooks: + - id: pyupgrade + args: [--py311-plus] +- repo: https://github.com/PyCQA/autoflake + rev: v2.3.1 + hooks: + - id: autoflake +- repo: https://github.com/PyCQA/isort + rev: 5.13.2 + hooks: + - id: isort + args: [--profile, black, --filter-files] +- repo: https://github.com/ambv/black + rev: 24.8.0 + hooks: + - id: black # Hooks for validation - repo: https://github.com/pre-commit/pre-commit-hooks @@ -29,6 +47,8 @@ repos: - id: check-json - id: check-toml - id: check-yaml + - id: check-ast + - id: debug-statements - repo: https://github.com/editorconfig-checker/editorconfig-checker.python rev: 3.0.3 hooks: diff --git a/spectator/client/gen-compose.py b/spectator/client/gen-compose.py index 57aa166..b297897 100644 --- a/spectator/client/gen-compose.py +++ b/spectator/client/gen-compose.py @@ -1,6 +1,7 @@ -import jinja2 import json import os + +import jinja2 from dotenv import load_dotenv load_dotenv()