From 0bb7d621d39d38bee7ce32e1ee920bd5bc4f9503 Mon Sep 17 00:00:00 2001 From: Jonathan Plasse <13716151+JonathanPlasse@users.noreply.github.com> Date: Sat, 18 Feb 2023 15:13:14 +0100 Subject: [PATCH] Fix pre-commit configuration (#9748) * Fix flake8 pre-commit hook to run on pyi files too * Fix pycln pre-commit hook * Run on pyi files too * Remove `stubs stdlib tests scripts` in args to avoid running pycln on files twice --- .pre-commit-config.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0d0e16580..c1f8a320a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,9 @@ repos: rev: v2.1.3 # must match requirements-tests.txt hooks: - id: pycln - args: [--config=pyproject.toml, stubs, stdlib, tests, scripts] + args: [--config=pyproject.toml] + types: [file] + types_or: [python, pyi] - repo: https://github.com/psf/black rev: 23.1.0 # must match requirements-tests.txt hooks: @@ -33,6 +35,8 @@ repos: - "flake8-bugbear==23.1.20" # must match requirements-tests.txt - "flake8-noqa==1.3.0" # must match requirements-tests.txt - "flake8-pyi==23.1.2" # must match requirements-tests.txt + types: [file] + types_or: [python, pyi] ci: autofix_commit_msg: "[pre-commit.ci] auto fixes from pre-commit.com hooks"