.pre-commit-config.yaml
# -*-mode:yml-*- vim:ft=yaml
# Config file for Pre-commit Git tool
#
# Insures base-line quality and consistency in all modified files when
# performing git commits.
# See:
# https://pre-commit.com/
# https://east.fm/posts/using-git-pre-commit-hooks/
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: check-added-large-files
description: "Prevents giant files from being committed."
- id: check-ast
description: "checks whether the files parse as valid python."
- id: check-byte-order-marker
description: "Forbids files which have a UTF-8 byte-order marker."
- id: check-case-conflict
description: "Checks for files that would conflict in case-insensitive filesystems."
- id: check-docstring-first
description: "Checks a common error of defining a docstring after code."
- id: check-json
description: "Checks json files for parsable syntax."
- id: check-merge-conflict
description: "Check for files that contain merge conflict strings."
- id: check-toml
description: "Checks toml files for parsable syntax."
- id: check-yaml
description: "Checks yaml files for parsable syntax."
- id: debug-statements
description: "Check for debugger imports and py37+ `breakpoint()` calls in python source."
- id: end-of-file-fixer
description: "Ensures that a file is either empty, or ends with one newline."
- id: fix-encoding-pragma
description: "Adds # -*- coding: utf-8 -*- to the top of python files."
- id: mixed-line-ending
description: "Replaces or checks mixed line ending."
args: [--fix=lf]
- id: name-tests-test
description: "Verifies that test files are named correctly."
args: [--django]
- id: pretty-format-json
description: "Sets a standard for formatting JSON files."
- id: requirements-txt-fixer
description: "Sorts entries in requirements.txt."
- id: trailing-whitespace
description: "Trims trailing whitespace."
- repo: https://github.com/ambv/black
rev: stable
hooks:
- id: black
description: "Black: The uncompromising Python code formatter"
entry: black
language: python
language_version: python3
require_serial: true
types: [python]
- repo: https://github.com/asottile/blacken-docs
rev: v1.5.0
hooks:
- id: blacken-docs
description: "Runs `black` on python code blocks in documentation files."
- repo: https://gitlab.com/pycqa/flake8
rev: 3.7.9
hooks:
- id: flake8
description: "Enforces style consistency across Python projects."
- repo: https://github.com/asottile/seed-isort-config
rev: v1.9.4
hooks:
- id: seed-isort-config
description: "Populates the known_third_party isort setting."
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort
description: "Sorts Python imports."
additional_dependencies: [toml]
exclude: ^(docs/conf\.py)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.761
hooks:
- id: mypy
args:
- --ignore-missing-imports
- repo: https://github.com/pre-commit/mirrors-pylint
rev: v2.4.4
hooks:
- id: pylint
description: "Checks for errors in Python code, tries to enforce a coding standard and looks for code smells."
args:
- --disable=E0401
- repo: https://github.com/Lucas-C/pre-commit-hooks-safety
rev: v1.1.0
hooks:
- id: python-safety-dependencies-check
description: "Analyzes your Python requirements for known security vulnerabilities."
- repo: https://github.com/PyCQA/bandit
rev: 1.6.0
hooks:
- id: bandit
description: "Finds common security issues in Python code."
exclude: ^(tests)/
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.5.1
hooks:
- id: python-check-blanket-noqa
description: "Enforces that `noqa` annotations always occur with specific codes."
- id: python-check-mock-methods
description: "Prevents a common mistake of `assert mck.not_called()` or `assert mck.called_once_with(...)`."
- id: python-no-eval
description: "Checks for the eval() built-in function."
- id: python-no-log-warn
description: "Checks for the deprecated `.warn()` method of python loggers."
- id: rst-backticks
description: "Detects common mistake of using single backticks when writing rst."
- id: text-unicode-replacement-char
description: "Forbids files which have a UTF-8 Unicode replacement character."
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 1.11.2
hooks:
- id: git-dirty
description: "Detects if git tree contains modified, staged, or untracked files."
- repo: https://github.com/pycqa/pydocstyle
rev: master
hooks:
- id: pydocstyle
description: "Checks compliance with Python docstring conventions."
- repo: https://github.com/mgedmin/check-manifest
rev: "0.40"
hooks:
- id: check-manifest
description: "Checks the completeness of MANIFEST.in."
- repo: https://github.com/Lucas-C/pre-commit-hooks-markup
rev: master
hooks:
- id: rst-linter
description: "Checks .rst files with the same linter used by pypi.org."
exclude: ^(docs)/