From f9fa3e75d9aaa1f4abb062054d90dc54660b9166 Mon Sep 17 00:00:00 2001 From: slackline Date: Wed, 27 Dec 2023 20:32:49 +0000 Subject: [PATCH] Adds some useful pre-commit/pre-commit-hooks + `debug-statements` - Checks for debug statements before commits. + `no-commit-to-branch` - Prevents commits being made to specific branches (`main` and `master` by default). --- .pre-commit-config.yaml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62c5a87..8f1c171 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,11 +7,13 @@ repos: - id: check-merge-conflict - id: check-toml - id: check-yaml + - id: debug-statements - id: end-of-file-fixer types: [python] - id: fix-byte-order-marker - id: name-tests-test args: ["--pytest-test-first"] + - id: no-commit-to-branch # Protects main/master by default - id: requirements-txt-fixer - id: trailing-whitespace types: [python, yaml, markdown] @@ -35,8 +37,8 @@ repos: - id: ruff args: [ --fix, --exit-non-zero-on-fix ] - - repo: https://github.com/psf/black - rev: 23.12.0 + - repo: https://github.com/psf/black-pre-commit-mirror + rev: 23.12.1 hooks: - id: black types: [python] @@ -49,6 +51,16 @@ repos: hooks: - id: nbstripout + - repo: https://github.com/numpy/numpydoc + rev: v1.6.0 + hooks: + - id: numpydoc-validation + exclude: | + (?x)( + tests/| + docs/ + ) + - repo: local hooks: - id: pylint