aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf W. Grosse-Kunstleve <rwgk@google.com>2023-06-16 14:09:40 -0700
committerGitHub <noreply@github.com>2023-06-16 14:09:40 -0700
commit86f60a0c072e5bd5cab79233f712c321fe8deca7 (patch)
tree0ac73b0ef3065366c00185c846c7d91daab83f4e
parent0e43fcc75e6b7429e3511dfb44343ec05a0ab843 (diff)
downloadpybind11-86f60a0c072e5bd5cab79233f712c321fe8deca7.tar.gz
pre-commit markdown-it-py<3 (for Python 3.7 compatibility) (#4704)
* markdown-it-py dropped Python 3.7 support, but we are type checking for Python 3.7 from a newer version of Python. Keep using markdown-it-py<3 as long as we support Python 3.7. * Shuffle order of pre-commit checks for better agility.
-rw-r--r--.pre-commit-config.yaml91
1 files changed, 47 insertions, 44 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index bcc3f272..2d508276 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -22,6 +22,48 @@ ci:
exclude: ^tools/JoinPaths.cmake$
repos:
+
+# Clang format the codebase automatically
+- repo: https://github.com/pre-commit/mirrors-clang-format
+ rev: "v16.0.4"
+ hooks:
+ - id: clang-format
+ types_or: [c++, c, cuda]
+
+# Black, the code formatter, natively supports pre-commit
+- repo: https://github.com/psf/black
+ rev: "23.3.0" # Keep in sync with blacken-docs
+ hooks:
+ - id: black
+
+# Ruff, the Python auto-correcting linter written in Rust
+- repo: https://github.com/charliermarsh/ruff-pre-commit
+ rev: v0.0.270
+ hooks:
+ - id: ruff
+ args: ["--fix", "--show-fixes"]
+
+# Check static types with mypy
+- repo: https://github.com/pre-commit/mirrors-mypy
+ rev: "v1.3.0"
+ hooks:
+ - id: mypy
+ args: []
+ exclude: ^(tests|docs)/
+ additional_dependencies:
+ - markdown-it-py<3 # Drop this together with dropping Python 3.7 support.
+ - nox
+ - rich
+
+# CMake formatting
+- repo: https://github.com/cheshirekow/cmake-format-precommit
+ rev: "v0.6.13"
+ hooks:
+ - id: cmake-format
+ additional_dependencies: [pyyaml]
+ types: [file]
+ files: (\.cmake|CMakeLists.txt)(.in)?$
+
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
@@ -39,12 +81,6 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
-# Black, the code formatter, natively supports pre-commit
-- repo: https://github.com/psf/black
- rev: "23.3.0" # Keep in sync with blacken-docs
- hooks:
- - id: black
-
# Also code format the docs
- repo: https://github.com/asottile/blacken-docs
rev: "1.13.0"
@@ -66,13 +102,6 @@ repos:
- id: fix-ligatures
- id: fix-smartquotes
-# Ruff, the Python auto-correcting linter written in Rust
-- repo: https://github.com/charliermarsh/ruff-pre-commit
- rev: v0.0.270
- hooks:
- - id: ruff
- args: ["--fix", "--show-fixes"]
-
# Checking for common mistakes
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
@@ -81,32 +110,6 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal
-
-# PyLint has native support - not always usable, but works for us
-- repo: https://github.com/PyCQA/pylint
- rev: "v3.0.0a6"
- hooks:
- - id: pylint
- files: ^pybind11
-
-# CMake formatting
-- repo: https://github.com/cheshirekow/cmake-format-precommit
- rev: "v0.6.13"
- hooks:
- - id: cmake-format
- additional_dependencies: [pyyaml]
- types: [file]
- files: (\.cmake|CMakeLists.txt)(.in)?$
-
-# Check static types with mypy
-- repo: https://github.com/pre-commit/mirrors-mypy
- rev: "v1.3.0"
- hooks:
- - id: mypy
- args: []
- exclude: ^(tests|docs)/
- additional_dependencies: [nox, rich]
-
# Checks the manifest for missing files (native support)
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
@@ -141,9 +144,9 @@ repos:
entry: PyBind|Numpy|Cmake|CCache|PyTest
exclude: ^\.pre-commit-config.yaml$
-# Clang format the codebase automatically
-- repo: https://github.com/pre-commit/mirrors-clang-format
- rev: "v16.0.4"
+# PyLint has native support - not always usable, but works for us
+- repo: https://github.com/PyCQA/pylint
+ rev: "v3.0.0a6"
hooks:
- - id: clang-format
- types_or: [c++, c, cuda]
+ - id: pylint
+ files: ^pybind11