From 6ebb814be3653e25ac39862a7822db6d0db8c6ee Mon Sep 17 00:00:00 2001 From: Dan Watson Date: Wed, 8 May 2024 09:08:36 -0400 Subject: [PATCH] Pre-commit --- .pre-commit-config.yaml | 14 ++++++++++++++ pyproject.toml | 1 + requirements-dev.lock | 19 +++++++++++++++++++ 3 files changed, 34 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..4f7f554 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,14 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.4.3 + hooks: + # Run the linter. + - id: ruff + args: ["--fix"] + # Run the formatter. + - id: ruff-format + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: v18.1.5 + hooks: + - id: clang-format diff --git a/pyproject.toml b/pyproject.toml index b5bf5cd..9ed133b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ managed = true dev-dependencies = [ "pytest>=7", "pytest-benchmark", + "pre-commit>=3.7.0", ] [tool.scikit-build] diff --git a/requirements-dev.lock b/requirements-dev.lock index 5ba3d1b..cdd4493 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -8,14 +8,33 @@ # with-sources: false -e file:. +cfgv==3.4.0 + # via pre-commit +distlib==0.3.8 + # via virtualenv +filelock==3.14.0 + # via virtualenv +identify==2.5.36 + # via pre-commit iniconfig==2.0.0 # via pytest +nodeenv==1.8.0 + # via pre-commit packaging==24.0 # via pytest +platformdirs==4.2.1 + # via virtualenv pluggy==1.5.0 # via pytest +pre-commit==3.7.0 py-cpuinfo==9.0.0 # via pytest-benchmark pytest==8.2.0 # via pytest-benchmark pytest-benchmark==4.0.0 +pyyaml==6.0.1 + # via pre-commit +setuptools==69.5.1 + # via nodeenv +virtualenv==20.26.1 + # via pre-commit