2020-09-23 22:42:21 +00:00
|
|
|
---
|
2020-11-26 17:41:06 +00:00
|
|
|
# All of the pre-commit hooks here actually use the `pytyhon` pre-commit language
|
|
|
|
# setting. However, for the python language setting, pre-commit will create and manage
|
|
|
|
# a cached virtual environment for each hook ID and do a bare `pip install <repo>` into
|
|
|
|
# the venv to setup the hook. This can result in conflicting dependency versions between
|
|
|
|
# the version installed to the pre-commit venv and the version installed to the Poetry
|
|
|
|
# venv specified in the lockfile.
|
|
|
|
#
|
|
|
|
# The solution is to specify `language: system` for all hooks and then install the
|
|
|
|
# required dependencies to the Poetry venv. The `system` language skips the isolated
|
|
|
|
# venv creation and looks for the entrypoint specified by the hook in the global
|
|
|
|
# environment which, if running in the Poetry venv, will find the entrypoint provided
|
|
|
|
# by the Poetry-managed dependency.
|
|
|
|
#
|
2020-09-23 22:42:21 +00:00
|
|
|
repos:
|
2021-02-10 01:20:47 +00:00
|
|
|
- repo: local
|
2020-11-26 17:41:06 +00:00
|
|
|
hooks:
|
|
|
|
- id: end-of-file-fixer
|
2021-02-10 01:20:47 +00:00
|
|
|
name: end-of-file-fixer
|
|
|
|
entry: end-of-file-fixer
|
2020-11-26 17:41:06 +00:00
|
|
|
language: system
|
2021-02-10 01:20:47 +00:00
|
|
|
types:
|
|
|
|
- text
|
|
|
|
|
2020-11-26 17:41:06 +00:00
|
|
|
- id: fix-encoding-pragma
|
2021-02-10 01:20:47 +00:00
|
|
|
name: fix-encoding-pragma
|
|
|
|
entry: fix-encoding-pragma
|
|
|
|
language: system
|
2020-11-26 17:41:06 +00:00
|
|
|
args:
|
|
|
|
- "--remove"
|
2021-02-10 01:20:47 +00:00
|
|
|
types:
|
|
|
|
- python
|
2020-11-26 17:41:06 +00:00
|
|
|
|
2021-02-10 01:20:47 +00:00
|
|
|
- id: trailing-whitespace-fixer
|
|
|
|
name: trailing-whitespace-fixer
|
|
|
|
entry: trailing-whitespace-fixer
|
2020-11-26 17:41:06 +00:00
|
|
|
language: system
|
2021-02-10 01:20:47 +00:00
|
|
|
types:
|
|
|
|
- text
|
2020-09-23 22:42:21 +00:00
|
|
|
|
2021-02-10 01:20:47 +00:00
|
|
|
- id: check-merge-conflict
|
|
|
|
name: check-merge-conflict
|
|
|
|
entry: check-merge-conflict
|
2020-11-26 17:41:06 +00:00
|
|
|
language: system
|
2021-02-10 01:20:47 +00:00
|
|
|
types:
|
|
|
|
- text
|
2020-09-23 22:42:21 +00:00
|
|
|
|
|
|
|
- id: reorder-python-imports
|
2021-02-10 01:20:47 +00:00
|
|
|
name: reorder-python-imports
|
2024-08-16 18:26:51 +00:00
|
|
|
entry: isort
|
2021-02-10 01:20:47 +00:00
|
|
|
language: system
|
2024-08-16 18:26:51 +00:00
|
|
|
require_serial: true
|
2021-02-10 01:20:47 +00:00
|
|
|
types:
|
|
|
|
- python
|
2024-08-16 18:26:51 +00:00
|
|
|
args:
|
|
|
|
- "--filter-files"
|
2021-02-10 01:20:47 +00:00
|
|
|
|
|
|
|
- id: black
|
|
|
|
name: black
|
|
|
|
entry: black
|
|
|
|
language: system
|
|
|
|
types:
|
|
|
|
- python
|
|
|
|
|
|
|
|
- id: blacken-docs
|
|
|
|
name: blacken-docs
|
|
|
|
entry: blacken-docs
|
2020-11-26 17:41:06 +00:00
|
|
|
language: system
|
2021-02-10 01:20:47 +00:00
|
|
|
types:
|
|
|
|
- text
|
2021-04-16 05:26:12 +00:00
|
|
|
|
|
|
|
- id: mdformat
|
|
|
|
name: mdformat
|
|
|
|
entry: mdformat
|
|
|
|
language: system
|
|
|
|
args:
|
|
|
|
- "--number"
|
|
|
|
- "--wrap=90"
|
|
|
|
types:
|
|
|
|
- markdown
|