Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Prompt users to run pre-commit when detecting ruff failures (#8338)

Chen Qiane4ec979a3d76
diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml
index 640802a56..6510c69ab 100644
--- a/.github/workflows/run_tests.yml
+++ b/.github/workflows/run_tests.yml
@@ -32,9 +32,18 @@ jobs:
echo "${{ github.workspace }}/.venv/bin" >> $GITHUB_PATH
- name: Install dependencies
run: uv sync --dev -p .venv --extra dev
- - name: Ruff Fix Attempt
- id: ruff_fix
- run: ruff check --fix-only --diff --exit-non-zero-on-fix
+ - name: Ruff Check
+ run: |
+ ruff check --fix-only --diff --exit-non-zero-on-fix || (
+ echo ""
+ echo "❌ Ruff found issues that can be fixed automatically."
+ echo "💡 To fix them locally, run:"
+ echo ""
+ echo " pre-commit run --all-files"
+ echo ""
+ echo "Then commit and push the changes."
+ exit 1
+ )
test:
name: Run Tests
diff --git a/dspy/clients/cache.py b/dspy/clients/cache.py
index d3bad5084..bfa7dbde8 100644
--- a/dspy/clients/cache.py
+++ b/dspy/clients/cache.py
@@ -30,6 +30,7 @@ class Cache:
disk_cache_dir: str,
disk_size_limit_bytes: Optional[int] = 1024 * 1024 * 10,
memory_max_entries: Optional[int] = 1000000,
+
):
"""
Args: