.pre-commit-config.yaml
---
repos:
- repo: local
hooks:
- id: blacken-docs
name: âī¸ Format documentation using black
language: system
files: '\.(rst|md|markdown|py|tex)$'
entry: poetry run blacken-docs
require_serial: true
- id: check-ast
name: đ Checking Python AST
language: system
types: [python]
entry: poetry run check-ast
- id: check-case-conflict
name: đ Checking for case conflicts
language: system
entry: poetry run check-case-conflict
- id: check-docstring-first
name: âšī¸ Checking docstrings are first
language: system
types: [python]
entry: poetry run check-docstring-first
- id: check-executables-have-shebangs
name: đ§ Checking that executables have shebangs
language: system
types: [text, executable]
entry: poetry run check-executables-have-shebangs
stages: [commit, push, manual]
- id: check-json
name: īŊ Checking JSON files
language: system
types: [json]
entry: poetry run check-json
- id: check-merge-conflict
name: đĨ Checking for merge conflicts
language: system
types: [text]
entry: poetry run check-merge-conflict
- id: check-symlinks
name: đ Checking for broken symlinks
language: system
types: [symlink]
entry: poetry run check-symlinks
- id: check-toml
name: â
Checking TOML files
language: system
types: [toml]
entry: poetry run check-toml
- id: check-yaml
name: â
Checking YAML files
language: system
types: [yaml]
entry: poetry run check-yaml
- id: codespell
name: â
Checking code for misspellings
language: system
types: [text]
exclude: ^poetry\.lock$
entry: poetry run codespell
- id: debug-statements
name: đĒĩ Checking for debug statements and imports (Python)
language: system
types: [python]
entry: poetry run debug-statement-hook
- id: detect-private-key
name: đĩī¸ Detecting private keys
language: system
types: [text]
entry: poetry run detect-private-key
- id: end-of-file-fixer
name: đ Checking end of files
language: system
types: [text]
entry: poetry run end-of-file-fixer
stages: [commit, push, manual]
- id: fix-byte-order-marker
name: đ Checking UTF-8 byte order marker
language: system
types: [text]
entry: poetry run fix-byte-order-marker
- id: format
name: âī¸ Formatting code using ruff
language: system
types: [python]
entry: poetry run ruff format
- id: isort
name: đ Sorting all imports with isort
language: system
types: [python]
entry: poetry run isort
- id: mypy
name: đ Performing static type checking using mypy
language: system
types: [python]
entry: poetry run mypy
require_serial: true
- id: no-commit-to-branch
name: đ Checking for commit to protected branch
language: system
entry: poetry run no-commit-to-branch
pass_filenames: false
always_run: true
args:
- --branch=dev
- --branch=main
- id: poetry
name: đ Checking pyproject with Poetry
language: system
entry: poetry check
pass_filenames: false
always_run: true
- id: pylint
name: đ Starring code with pylint
language: system
types: [python]
entry: poetry run pylint
- id: pyupgrade
name: đ Checking for upgradable syntax with pyupgrade
language: system
types: [python]
entry: poetry run pyupgrade
args: [--py39-plus, --keep-runtime-typing]
- id: ruff
name: đ Enforcing style guide with ruff
language: system
types: [python]
entry: poetry run ruff check --fix
- id: trailing-whitespace
name: â Trimming trailing whitespace
language: system
types: [text]
entry: poetry run trailing-whitespace-fixer
stages: [commit, push, manual]
- id: vulture
name: đ Finding unused Python code with Vulture
language: system
types: [python]
entry: poetry run vulture
pass_filenames: false
require_serial: true
- id: yamllint
name: đ Checking YAML files with yamllint
language: system
types: [yaml]
entry: poetry run yamllint
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.4"
hooks:
- id: prettier
name: đ Ensuring files are prettier