58 lines
2.0 KiB
YAML
58 lines
2.0 KiB
YAML
---
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.2.0
|
|
hooks:
|
|
- id: check-merge-conflict
|
|
- id: debug-statements
|
|
- id: end-of-file-fixer
|
|
- id: no-commit-to-branch
|
|
args: [--branch, main]
|
|
- id: trailing-whitespace
|
|
|
|
- repo: https://github.com/asottile/add-trailing-comma
|
|
rev: v2.2.3
|
|
hooks:
|
|
- id: add-trailing-comma
|
|
|
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
rev: "v2.6.2"
|
|
hooks:
|
|
- id: prettier
|
|
# Original hook implementation is flaky due to *several* bugs described
|
|
# in https://github.com/prettier/prettier/issues/12364
|
|
# a) CI=1 needed to avoid incomplete output
|
|
# b) two executions are needed because --list-different works correctly
|
|
# only when run with --check as with --write the output will also
|
|
# include other entries and logging level cannot be used to keep only
|
|
# modified files listed (any file is listed using the log level, regardless if
|
|
# is modified or not).
|
|
# c) We avoid letting pre-commit pass each filename in order to avoid
|
|
# running multiple instances in parallel. This also ensures that running
|
|
# prettier from the command line behaves identically with the pre-commit
|
|
# one. No real performance downsides.
|
|
# d) exit with the return code from list-different (0=none, 1=some)
|
|
# rather than the write (0=successfully rewrote files). pre-commit.ci
|
|
entry: env CI=1 bash -c "prettier --list-different . || ec=$? && prettier --loglevel=error --write . && exit $ec"
|
|
pass_filenames: false
|
|
args: []
|
|
additional_dependencies:
|
|
- prettier
|
|
- prettier-plugin-toml
|
|
|
|
- repo: https://github.com/PyCQA/isort
|
|
rev: 5.10.1
|
|
hooks:
|
|
- id: isort
|
|
name: Sort import statements using isort
|
|
|
|
- repo: https://github.com/psf/black
|
|
rev: 22.3.0
|
|
hooks:
|
|
- id: black
|
|
|
|
- repo: https://github.com/ansible-network/collection_prep
|
|
rev: 1.0.0
|
|
hooks:
|
|
- id: update-docs
|