Skip to content

Commit 1c55e31

Browse files
committed
Only run generate-config using pre-commit
1 parent 4e5166b commit 1c55e31

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

.evergreen/scripts/generate-config.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
# Entry point for the generate-config pre-commit hook.
3+
4+
set -eu
5+
6+
python .evergreen/scripts/generate_config.py

.evergreen/scripts/generate_config.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
# /// script
2-
# requires-python = ">=3.9"
3-
# dependencies = [
4-
# "shrub.py>=3.2.0",
5-
# "pyyaml>=6.0.2"
6-
# ]
7-
# ///
8-
9-
# Note: Run this file with `pipx run`, or `uv run`.
1+
# Note: See CONTRIBUTING.md for how to update/run this file.
102
from __future__ import annotations
113

124
import sys

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,8 @@ repos:
116116
(?x)(
117117
.evergreen/retry-with-backoff.sh
118118
)
119+
- id: generate-config
120+
name: generate-config
121+
entry: .evergreen/scripts/generate-config.sh
122+
language: python
123+
additional_dependencies: ["shrub.py>=3.2.0", "pyyaml>=6.0.2"]

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ If you are running one of the `no-responder` tests, omit the `run-server` step.
367367
- If there are any special test considerations, including not running `pytest` at all, handle it in `.evergreen/scripts/run_tests.py`.
368368
- If there are any services or atlas clusters to teardown, handle them in `.evergreen/scripts/teardown_tests.py`.
369369
- Add functions to generate the test variant(s) and task(s) to the `.evergreen/scripts/generate_config.py`.
370-
- Regenerate the test variants and tasks using the instructions in `.evergreen/scripts/generate_config.py`.
370+
- Regenerate the test variants and tasks using `pre-commit run generate-config`.
371371
- Make sure to add instructions for running the test suite to `CONTRIBUTING.md`.
372372

373373
## Re-sync Spec Tests

0 commit comments

Comments
 (0)