From 67e292ad8b429ddf5d8100ca53d6aab44ddeaa9b Mon Sep 17 00:00:00 2001 From: Adrienne Stilp Date: Fri, 22 Mar 2024 17:19:14 -0700 Subject: [PATCH] Try adding a pre-commit hook for pip-compile Compile all the requirements files at the pre-merge-commit stage. Not sure if this will work. --- .pre-commit-config.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 842469d1..fd7b3085 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,6 +32,23 @@ repos: hooks: - id: gitleaks + - repo: https://github.com/jazzband/pip-tools + rev: 7.4.1 + hooks: + - id: pip-compile + stages: [pre-merge-commit] + name: pip-compile requirements.in + files: ^requirements/requirements\.(in|txt)$ + - id: pip-compile + stages: [pre-merge-commit] + name: pip-compile test-requirements.in + args: [test-requirements.in] + files: ^requirements/test-requirements\.(in|txt)$ + - id: pip-compile + stages: [pre-merge-commit] + name: pip-compile dev-requirements.in + args: [dev-requirements.in] + files: ^requirements/dev-requirements\.(in|txt)$ # sets up .pre-commit-ci.yaml to ensure pre-commit dependencies stay up to date ci: