Skip to content

Commit

Permalink
chore(pre-commit): make use of default_stages in commit
Browse files Browse the repository at this point in the history
So we don't have to repeat `stages: [commit]` for almost all checks.
  • Loading branch information
scop committed Sep 18, 2021
1 parent c7dcf40 commit aa5a326
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
default_stages: [commit]

repos:

- repo: https://github.com/jorisroovers/gitlint
Expand All @@ -17,7 +19,6 @@ repos:
types: [text]
files: ^(bash_completion|completions/.+|test/(config/bashrc|update-test-cmd-list)|.+\.sh(\.in)?)$
exclude: ^completions/(\.gitignore|Makefile.*)$
stages: [commit]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.7.2.1
Expand All @@ -28,7 +29,6 @@ repos:
files: ^(bash_completion|completions/.+|test/(config/bashrc|update-test-cmd-list)|.+\.sh(\.in)?)$
exclude: ^completions/(\.gitignore|Makefile.*)$
require_serial: false # We disable SC1090 anyway, so parallel is ok
stages: [commit]

- repo: local
hooks:
Expand All @@ -38,7 +38,6 @@ repos:
entry: test/update-test-cmd-list
files: ^test/t/.+\.py$
pass_filenames: false
stages: [commit]

- repo: https://github.com/psf/black
rev: 21.7b0
Expand All @@ -47,7 +46,6 @@ repos:
types: [text]
files: ^(helpers/python|.+\.py)$
exclude: ^completions/
stages: [commit]

- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
Expand All @@ -66,14 +64,12 @@ repos:
types: [text]
files: ^(helpers/python|.+\.py)$
exclude: ^completions/
stages: [commit]

- repo: https://github.com/PyCQA/isort
rev: 5.9.3
hooks:
- id: isort
args: [--filter-files, --settings-path=test/setup.cfg]
stages: [commit]

- repo: local
hooks:
Expand All @@ -88,23 +84,20 @@ repos:
types: [python]
# Intentionally not run on helpers/python (we support very old versions)
exclude: ^completions/|^test/fixtures/pytest/
stages: [commit]

- repo: https://github.com/asottile/pyupgrade
rev: v2.24.0
hooks:
- id: pyupgrade
args: [--py36-plus, --keep-percent-format]
exclude: ^completions/
stages: [commit]

- repo: https://github.com/perltidy/perltidy
rev: "20210717"
hooks:
- id: perltidy
types: [text]
files: ^(helpers/perl|.+\.p[ml])$
stages: [commit]

- repo: local
hooks:
Expand All @@ -116,24 +109,20 @@ repos:
args: [--quiet, --verbose, "5"]
types: [text]
files: ^(helpers/perl|.+\.p[ml])$
stages: [commit]

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.28.1
hooks:
- id: markdownlint
exclude: ^CHANGELOG\.md$
stages: [commit]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-case-conflict
stages: [commit]

- repo: https://github.com/crate-ci/typos
rev: v1.0.11
hooks:
- id: typos
exclude: ^(CHANGELOG\.md|test/(test-cmd-list\.txt|fixtures/.+))$
stages: [commit]

0 comments on commit aa5a326

Please sign in to comment.