From a847cfb4e598675afe4ef182b0c52f8e71b30c45 Mon Sep 17 00:00:00 2001 From: PuQing Date: Tue, 30 Jan 2024 17:04:42 +0800 Subject: [PATCH] Update pre-commit hooks configuration --- .pre-commit-config.yaml | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b563833..241fc5b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,32 +16,23 @@ repos: hooks: - id: pretty-format-yaml args: [--autofix, --indent, '2'] -- repo: local + +- repo: https://github.com/psf/black.git + rev: 23.3.0 hooks: - id: black - name: Format with Black - entry: poetry run -C backend/app -- black - language: system - types: [python] - - id: autoflake - name: autoflake - entry: poetry run -C backend/app -- autoflake - language: system - types: [python] + files: (.*\.(py|pyi))$ +- repo: https://github.com/PyCQA/flake8 + rev: 5.0.4 + hooks: - id: flake8 - name: Check with Flake8 - entry: poetry run -C backend/app -- flake8 - language: system - pass_filenames: false - types: [python] - args: [--count, .] + args: [--config=.flake8] +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.5 + hooks: - id: ruff - name: Format with Ruff - entry: poetry run -C backend/app -- ruff - language: system - types: [python] args: [--fix, --exit-non-zero-on-fix, --no-cache] ci: