From 94d6d8efa919a2b42276771c49ddd78797ff36b9 Mon Sep 17 00:00:00 2001 From: Pete Peterson Date: Thu, 14 Nov 2024 13:58:00 -0500 Subject: [PATCH] Add pre-commit tool and configuration --- .pre-commit-config.yaml | 26 ++++++++++++++++++++++++++ environment.yml | 3 ++- 2 files changed, 28 insertions(+), 1 deletion(-) 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..9719b7d --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,26 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-added-large-files + args: [--maxkb=8192] + - id: check-merge-conflict + - id: check-yaml + args: [--allow-multiple-documents] + exclude: "conda.recipe/meta.yaml" + - id: end-of-file-fixer + exclude: "tests/cis_tests/.*" + - id: trailing-whitespace + exclude: "tests/cis_tests/.*" +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.7.3 + hooks: + - id: ruff + args: [--fix, --exit-non-zero-on-fix] + exclude: "tests/cis_tests/.*" + - id: ruff-format + exclude: "tests/cis_tests/.*" +- repo: https://github.com/codespell-project/codespell + rev: v2.3.0 + hooks: + - id: codespell diff --git a/environment.yml b/environment.yml index 2fb48e9..20d4c70 100644 --- a/environment.yml +++ b/environment.yml @@ -3,7 +3,8 @@ channels: - conda-forge dependencies: - h5py - - numpy + - numpy=1 # for now + - pre-commit - pytest - pytest-cov - versioningit