From b34029b2f489958cd0d1cf3b6366a773b1ba10af Mon Sep 17 00:00:00 2001 From: iamashwin99 <ashwin-kumar.karnad@mpsd.mpg.de> Date: Wed, 21 Jun 2023 15:09:05 +0200 Subject: [PATCH] add basic precommit hook config --- .pre-commit-config.yaml | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..44af4af --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,58 @@ +# Config based on https://gitlab.com/octopus-code/postopus/-/blob/main/.pre-commit-config.yaml +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: check-ast + - id: check-docstring-first + - id: check-executables-have-shebangs + - id: check-json + - id: check-merge-conflict + - id: check-xml + - id: check-yaml + - id: check-toml + - id: debug-statements + - id: end-of-file-fixer + - id: requirements-txt-fixer + - id: mixed-line-ending + args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows + +# other hooks +# Ruff: +- repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.0.274 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + +# Black +- repo: https://github.com/psf/black + rev: 22.12.0 + hooks: + - id: black + language_version: python3 + +## If like to embrace black styles even in the docs: +# - repo: https://github.com/asottile/blacken-docs +# rev: v1.9.1 +# hooks: +# - id: blacken-docs +# additional_dependencies: [black] + +# pydocstyle +- repo: https://github.com/PyCQA/pydocstyle + rev: 6.1.1 + hooks: + - id: pydocstyle + name: pydocstyle + description: pydocstyle is a static analysis tool for checking compliance with Python docstring conventions. + entry: pydocstyle + language: python + types: [python] + +- repo: https://github.com/abravalheri/validate-pyproject + rev: v0.10.1 + hooks: + - id: validate-pyproject -- GitLab