From 5ed40e089f5e5f33a125dc145f6d678fef0584ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Tue, 17 Mar 2020 21:43:31 +0200 Subject: [PATCH] pre-commit: run most python checks on helpers/python too Refs https://github.com/scop/bash-completion/pull/396 --- .pre-commit-config.yaml | 13 ++++++++++--- helpers/python | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 541a1a0f7d2..f7030c8a3ee 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,26 +3,33 @@ repos: rev: 19.10b0 hooks: - id: black + types: [text] + files: ^(helpers/python|.+\.py)$ exclude: completions/ - repo: https://gitlab.com/pycqa/flake8 rev: 3.7.9 hooks: - id: flake8 - exclude: completions/ args: [--config=test/setup.cfg] additional_dependencies: [flake8-bugbear==20.1.4] + types: [text] + files: ^(helpers/python|.+\.py)$ + exclude: completions/ - repo: https://github.com/pre-commit/mirrors-isort rev: v4.3.21 hooks: - id: isort - exclude: completions/ args: [--settings-path=test/setup.cfg] + types: [text] + files: ^(helpers/python|.+\.py)$ + exclude: completions/ - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.770 hooks: - id: mypy - exclude: completions/ args: [--config-file=test/setup.cfg] + # Intentionally not run on helpers/python (support very old versions) + exclude: completions/ - repo: https://github.com/ryanrhee/shellcheck-py rev: v0.7.0.1-1 hooks: diff --git a/helpers/python b/helpers/python index 9e26825234e..a74387f30a0 100644 --- a/helpers/python +++ b/helpers/python @@ -11,4 +11,4 @@ else: walker = pkgutil.iter_modules for mod in walker(): - print (mod[1]) # noqa: E211 + print(mod[1]) # noqa: E211