From e2acedad480ec42adabb3441d4c1e421dcca60dc Mon Sep 17 00:00:00 2001 From: James Lamb Date: Mon, 5 Feb 2024 11:07:06 -0600 Subject: [PATCH] add rapids-dependency-file-generator pre-commit hook (#531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributes to https://github.com/rapidsai/shared-workflows/issues/46. Proposes adding a pre-commit hook to run `rapids-dependency-file-generator`. With that change, local `pre-commit` and CI will raise an error if changes to `dependencies.yaml` cause some error from `rapids-dependency-file-generator`. If this project checks any files modified by that tool into source control in the future, it'd also raise an error if any of those files change. This is a bit cheaper way to find out about things like typos, misaligning spacing, etc. than waiting for CI to report it. It's very fast, shouldn't be noticeable in day-to-day development. ### How I tested this Changed an `output: conda` to `output: condafile` (not a valid output type) in `dependencies.yaml`. Ran `pre-commit run --all-files`. Observed the expected failure. Screenshot 2024-01-31 at 9 14 10 AM Reverted that change, ran `pre-commit run --all-files` again, saw everything pass. Authors: - James Lamb (https://github.com/jameslamb) Approvers: - Kyle Edwards (https://github.com/KyleFromNVIDIA) URL: https://github.com/rapidsai/rapids-cmake/pull/531 --- .pre-commit-config.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8369d5dc..100b6b0e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,6 +25,11 @@ repos: rev: v2.2.2 hooks: - id: codespell + - repo: https://github.com/rapidsai/dependency-file-generator + rev: v1.8.0 + hooks: + - id: rapids-dependency-file-generator + args: ["--clean"] - repo: local hooks: - id: copyright-check