.pre-commit-config.yaml
---
repos:
- repo: local
hooks:
- id: ruff-check
name: ๐ถ Ruff Linter
language: system
types: [python]
entry: poetry run ruff check --fix
require_serial: true
stages: [commit, push, manual]
- id: ruff-format
name: ๐ถ Ruff Formatter
language: system
types: [python]
entry: poetry run ruff format
require_serial: true
stages: [commit, push, manual]
- id: check-ast
name: ๐ Check Python AST
language: system
types: [python]
entry: poetry run check-ast
- id: check-case-conflict
name: ๐ Check for case conflicts
language: system
entry: poetry run check-case-conflict
- id: check-docstring-first
name: โน๏ธ Check docstring is first
language: system
types: [python]
entry: poetry run check-docstring-first
- id: check-executables-have-shebangs
name: ๐ง Check that executables have shebangs
language: system
types: [text, executable]
entry: poetry run check-executables-have-shebangs
stages: [commit, push, manual]
- id: check-json
name: ๏ฝ Check JSON files
language: system
types: [json]
entry: poetry run check-json
- id: check-merge-conflict
name: ๐ฅ Check for merge conflicts
language: system
types: [text]
entry: poetry run check-merge-conflict
- id: check-symlinks
name: ๐ Check for broken symlinks
language: system
types: [symlink]
entry: poetry run check-symlinks
- id: check-toml
name: โ
Check TOML files
language: system
types: [toml]
entry: poetry run check-toml
- id: check-xml
name: โ
Check XML files
entry: poetry run check-xml
language: system
types: [xml]
- id: check-yaml
name: โ
Check YAML files
language: system
types: [yaml]
entry: poetry run check-yaml
- id: codespell
name: โ
Check code for common misspellings
language: system
types: [text]
exclude: ^poetry\.lock$
entry: poetry run codespell
args: [--ignore-words=.codespell-ignore]
- id: detect-private-key
name: ๐ต๏ธ Detect Private Keys
language: system
types: [text]
entry: poetry run detect-private-key
- id: end-of-file-fixer
name: โฎ Fix End of Files
language: system
types: [text]
entry: poetry run end-of-file-fixer
stages: [commit, push, manual]
- id: mypy
name: ๐ Static type checking using mypy
language: system
types: [python]
entry: poetry run mypy
- id: no-commit-to-branch
name: ๐ Don't commit to main branch
language: system
entry: poetry run no-commit-to-branch
pass_filenames: false
always_run: true
args:
- --branch=main
- id: poetry
name: ๐ Check 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: pytest
name: ๐งช Running tests and test coverage with pytest
language: system
types: [python]
entry: poetry run pytest
pass_filenames: false
- id: trailing-whitespace
name: โ Trim Trailing Whitespace
language: system
types: [text]
entry: poetry run trailing-whitespace-fixer
stages: [commit, push, manual]
- id: yamllint
name: ๐ Check YAML files with yamllint
language: system
types: [yaml]
entry: poetry run yamllint