2019-03-11 12:52:57 +00:00
|
|
|
---
|
2019-11-15 16:50:38 +00:00
|
|
|
default_language_version:
|
|
|
|
# force all unspecified python hooks to run python3
|
|
|
|
python: python3
|
|
|
|
|
2019-03-11 12:52:57 +00:00
|
|
|
repos:
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2021-04-15 15:36:21 +00:00
|
|
|
rev: v4.0.1
|
2019-03-11 12:52:57 +00:00
|
|
|
hooks:
|
2020-12-16 23:21:03 +00:00
|
|
|
- id: check-case-conflict
|
2019-03-11 12:52:57 +00:00
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
- id: check-json
|
|
|
|
- id: check-merge-conflict
|
2020-12-16 23:21:03 +00:00
|
|
|
- id: check-toml
|
2019-03-11 12:52:57 +00:00
|
|
|
- id: check-xml
|
|
|
|
- id: debug-statements
|
|
|
|
- id: detect-aws-credentials
|
|
|
|
args:
|
|
|
|
- --allow-missing-credentials
|
|
|
|
- id: detect-private-key
|
|
|
|
- id: end-of-file-fixer
|
|
|
|
exclude: files/(issue|motd)
|
|
|
|
- id: mixed-line-ending
|
|
|
|
args:
|
|
|
|
- --fix=lf
|
|
|
|
- id: pretty-format-json
|
|
|
|
args:
|
|
|
|
- --autofix
|
|
|
|
- id: requirements-txt-fixer
|
|
|
|
- id: trailing-whitespace
|
2020-11-16 04:02:59 +00:00
|
|
|
|
|
|
|
# Text file hooks
|
2019-03-11 12:52:57 +00:00
|
|
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
2021-08-10 03:46:40 +00:00
|
|
|
rev: v0.28.1
|
2019-03-11 12:52:57 +00:00
|
|
|
hooks:
|
|
|
|
- id: markdownlint
|
2019-06-24 21:14:02 +00:00
|
|
|
args:
|
2021-06-18 07:51:38 +00:00
|
|
|
- --config=.mdl_config.yaml
|
2020-12-16 23:03:13 +00:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
2021-07-13 15:27:26 +00:00
|
|
|
rev: v2.3.2
|
2020-11-16 04:02:59 +00:00
|
|
|
hooks:
|
|
|
|
- id: prettier
|
2019-03-11 12:52:57 +00:00
|
|
|
- repo: https://github.com/adrienverge/yamllint
|
2021-08-10 03:46:40 +00:00
|
|
|
rev: v1.26.2
|
2019-03-11 12:52:57 +00:00
|
|
|
hooks:
|
|
|
|
- id: yamllint
|
2021-01-07 09:07:38 +00:00
|
|
|
args:
|
|
|
|
- --strict
|
2020-11-16 04:02:59 +00:00
|
|
|
|
2021-06-24 05:38:44 +00:00
|
|
|
# pre-commit hooks
|
|
|
|
- repo: https://github.com/pre-commit/pre-commit
|
2021-08-10 03:46:40 +00:00
|
|
|
rev: v2.14.0
|
2021-06-24 05:38:44 +00:00
|
|
|
hooks:
|
|
|
|
- id: validate_manifest
|
|
|
|
|
2020-11-16 04:02:59 +00:00
|
|
|
# Shell script hooks
|
2021-07-13 21:53:55 +00:00
|
|
|
- repo: https://github.com/cisagov/pre-commit-shfmt
|
|
|
|
rev: v0.0.2
|
2021-01-15 15:34:34 +00:00
|
|
|
hooks:
|
2021-07-13 21:53:55 +00:00
|
|
|
- id: shfmt
|
2021-01-15 15:34:34 +00:00
|
|
|
args:
|
2021-07-13 21:53:55 +00:00
|
|
|
# Indent by two spaces
|
|
|
|
- -i
|
2021-01-15 15:34:34 +00:00
|
|
|
- '2'
|
2021-07-13 21:53:55 +00:00
|
|
|
# Binary operators may start a line
|
|
|
|
- -bn
|
|
|
|
# Switch cases are indented
|
|
|
|
- -ci
|
|
|
|
# Redirect operators are followed by a space
|
|
|
|
- -sr
|
2019-03-11 12:52:57 +00:00
|
|
|
- repo: https://github.com/detailyang/pre-commit-shell
|
2019-05-26 15:57:27 +00:00
|
|
|
rev: 1.0.5
|
2019-03-11 12:52:57 +00:00
|
|
|
hooks:
|
|
|
|
- id: shell-lint
|
2020-11-16 04:02:59 +00:00
|
|
|
|
|
|
|
# Python hooks
|
2019-04-04 02:51:50 +00:00
|
|
|
- repo: https://github.com/PyCQA/bandit
|
2020-12-16 23:30:17 +00:00
|
|
|
rev: 1.7.0
|
2019-04-04 02:51:50 +00:00
|
|
|
hooks:
|
|
|
|
- id: bandit
|
2019-05-03 20:49:35 +00:00
|
|
|
args:
|
|
|
|
- --config=.bandit.yml
|
2020-12-16 23:13:04 +00:00
|
|
|
- repo: https://github.com/psf/black
|
2021-07-13 15:27:26 +00:00
|
|
|
rev: 21.7b0
|
2019-03-11 12:52:57 +00:00
|
|
|
hooks:
|
|
|
|
- id: black
|
2020-11-16 04:02:59 +00:00
|
|
|
- repo: https://gitlab.com/pycqa/flake8
|
2021-04-15 15:36:21 +00:00
|
|
|
rev: 3.9.2
|
2020-11-16 04:02:59 +00:00
|
|
|
hooks:
|
|
|
|
- id: flake8
|
|
|
|
additional_dependencies:
|
|
|
|
- flake8-docstrings
|
2020-12-17 18:50:34 +00:00
|
|
|
- repo: https://github.com/PyCQA/isort
|
2021-08-10 03:46:40 +00:00
|
|
|
rev: 5.9.3
|
2019-12-19 20:32:36 +00:00
|
|
|
hooks:
|
|
|
|
- id: isort
|
2020-11-16 04:02:59 +00:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
2021-07-13 15:27:26 +00:00
|
|
|
rev: v0.910
|
2020-11-16 04:02:59 +00:00
|
|
|
hooks:
|
|
|
|
- id: mypy
|
|
|
|
- repo: https://github.com/asottile/pyupgrade
|
2021-08-10 03:46:40 +00:00
|
|
|
rev: v2.23.3
|
2020-11-16 04:02:59 +00:00
|
|
|
hooks:
|
|
|
|
- id: pyupgrade
|
|
|
|
|
|
|
|
# Ansible hooks
|
2020-12-31 20:06:18 +00:00
|
|
|
- repo: https://github.com/ansible-community/ansible-lint
|
2021-02-16 18:18:08 +00:00
|
|
|
# This is intentionally being held back because of issues in v5 per
|
|
|
|
# https://github.com/cisagov/skeleton-ansible-role/issues/69
|
2020-12-16 23:30:17 +00:00
|
|
|
rev: v4.3.7
|
2019-11-02 23:48:42 +00:00
|
|
|
hooks:
|
|
|
|
- id: ansible-lint
|
2020-02-20 22:29:09 +00:00
|
|
|
# files: molecule/default/playbook.yml
|
2020-11-16 04:02:59 +00:00
|
|
|
|
|
|
|
# Terraform hooks
|
2020-12-16 23:15:03 +00:00
|
|
|
- repo: https://github.com/antonbabenko/pre-commit-terraform
|
2021-04-15 15:36:21 +00:00
|
|
|
rev: v1.50.0
|
2019-03-11 12:52:57 +00:00
|
|
|
hooks:
|
|
|
|
- id: terraform_fmt
|
2021-08-26 13:56:34 +00:00
|
|
|
- id: terraform_validate
|
2020-11-16 04:02:59 +00:00
|
|
|
|
|
|
|
# Docker hooks
|
2019-03-30 15:45:50 +00:00
|
|
|
- repo: https://github.com/IamTheFij/docker-pre-commit
|
2021-07-13 15:27:26 +00:00
|
|
|
rev: v2.0.1
|
2019-03-30 15:45:50 +00:00
|
|
|
hooks:
|
|
|
|
- id: docker-compose-check
|
2020-12-31 20:09:53 +00:00
|
|
|
|
|
|
|
# Packer hooks
|
|
|
|
- repo: https://github.com/cisagov/pre-commit-packer
|
|
|
|
rev: v0.0.2
|
|
|
|
hooks:
|
|
|
|
- id: packer_validate
|
|
|
|
- id: packer_fmt
|