chia-blockchain/.pre-commit-config.yaml
Kyle Altendorf fda14b5b47
restrict click to < 8.1 for black (#10923)
https://github.com/pallets/click/issues/2225

Doing this instead of updating since updating black will change several
files due to some formatting change.  I would like to take that on
separately from unbreaking CI.
2022-03-28 19:49:22 -07:00

71 lines
2.3 KiB
YAML

repos:
- repo: local
hooks:
- id: build-workflows
name: Validate github action workflows
entry: ./tests/build-workflows.py --fail-on-update
language: python
pass_filenames: false
- id: check-sql
name: Validate SQL statements
entry: ./tests/check_sql_statements.py
language: python
pass_filenames: false
- repo: local
hooks:
- id: init_py_files
name: __init__.py files
entry: python3 tests/build-init-files.py -v --root .
language: python
pass_filenames: false
additional_dependencies: [click~=7.1]
# The following, commented hook is the usual way to add isort. However, it doesn't work in some environments.
# See https://github.com/PyCQA/isort/issues/1874#issuecomment-1002212936
# -----------------------------------------------------
# - repo: https://github.com/pycqa/isort
# rev: 5.9.3
# hooks:
# - id: isort
# -----------------------------------------------------
# The hook below is the workaround for the issue above.
- repo: local
hooks:
- id: isort
name: isort
entry: isort
require_serial: true
language: python
language_version: python3
types_or: [cython, pyi, python]
args: ['--filter-files']
minimum_pre_commit_version: '2.9.2'
additional_dependencies: [isort==5.10.1]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: check-yaml
- id: end-of-file-fixer
exclude: ".*?(.hex|.clvm|.clib)"
- id: trailing-whitespace
- id: check-merge-conflict
- id: check-ast
- id: debug-statements
- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
- id: black
additional_dependencies: ['click<8.1']
- repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.942
hooks:
- id: mypy
additional_dependencies: [filelock, pytest, pytest-asyncio, types-aiofiles, types-click, types-setuptools, types-PyYAML]
# This intentionally counters the settings in mypy.ini to allow a loose local
# check and a strict CI check. This difference may or may not be retained long
# term.
args: [--no-warn-unused-ignores]