Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

chore: fix ruff linting in tests and refine pre-commit config

RinCodeForge9273b203440545f
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index c1ca777bc..3410da9cc 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -19,11 +19,11 @@ repos:
# Remove trailing whitespace
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- exclude: ^(.*\.min\.(js|css)|.*\.lock|.*\.log|.*\.pdf|.*\.zip|.*\.tar\.gz)
+ exclude: ^(assets/roster/.*\.svg|.*\.min\.(js|css)|.*\.lock|.*\.log|.*\.pdf|.*\.zip|.*\.tar\.gz)
# Ensure files end with a newline
- id: end-of-file-fixer
- exclude: ^(.*\.min\.(js|css)|.*\.lock|.*\.log|.*\.pdf|.*\.zip|.*\.tar\.gz)
+ exclude: ^(assets/roster/.*\.svg|.*\.min\.(js|css)|.*\.lock|.*\.log|.*\.pdf|.*\.zip|.*\.tar\.gz)
# Check YAML files for syntax errors
- id: check-yaml
@@ -55,11 +55,9 @@ repos:
# Ruff linting - removing --exit-zero to ensure we catch issues before they land
- id: ruff
args: [--fix]
- files: ^(src/|scripts/).*\.py$
# Ruff import sorting
- id: ruff-format
- files: ^(src/|scripts/).*\.py$
# ============================================
# Frontend code formatting and linting
@@ -72,8 +70,9 @@ repos:
# files: ^web/.*\.(js|jsx|ts|tsx)$
# exclude: ^web/(node_modules|\.next|out|dist|build)/
# additional_dependencies:
- # - eslint@^8.57.0
+ # - eslint@^9.0.0
+ # - eslint-config-next@^15.0.0
+ # - "@eslint/eslintrc"
# args: [--fix]
- repo: https://github.com/pre-commit/mirrors-prettier
diff --git a/tests/agents/solve/utils/test_json_utils.py b/tests/agents/solve/utils/test_json_utils.py
index 4c80b3093..8dcc07171 100644
--- a/tests/agents/solve/utils/test_json_utils.py
+++ b/tests/agents/solve/utils/test_json_utils.py
@@ -1,4 +1,3 @@
-import pytest
from src.agents.solve.utils.json_utils import extract_json_from_text
@@ -26,7 +25,6 @@ def foo():
assert "def foo" in parsed["tool_calls"][0]["query"]
-
# How to run the test
# From repo root:
# pytest
diff --git a/tests/core/test_prompt_manager.py b/tests/core/test_prompt_manager.py
index 6c613ec4b..991149197 100644
--- a/tests/core/test_prompt_manager.py
+++ b/tests/core/test_prompt_manager.py
@@ -3,10 +3,11 @@
Unit tests for the unified PromptManager.
"""
-import pytest
from pathlib import Path
import sys
+import pytest
+
# Add project root to path
project_root = Path(__file__).parent.parent.parent
sys.path.insert(0, str(project_root))