claude-dev-env 8.26.0 → 8.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/hooks/blocking/test_code_rules_boolean_mustcheck.py +9 -0
- package/hooks/blocking/test_code_rules_enforcer.py +9 -0
- package/hooks/blocking/test_code_rules_imports_logging.py +9 -0
- package/hooks/hooks_constants/test_usage_pace_constants.py +10 -0
- package/hooks/routing/test_conftest.py +18 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from code_rules_boolean_mustcheck import check_boolean_naming
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_boolean_assignment_requires_a_prefix() -> None:
|
|
5
|
+
content = "def check() -> None:\n enabled = True\n"
|
|
6
|
+
|
|
7
|
+
assert check_boolean_naming(content, "src/checks.py") == [
|
|
8
|
+
"Line 2: Boolean enabled - prefix with is_/has_/should_/can_/was_/did_"
|
|
9
|
+
]
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from code_rules_enforcer import validate_content_for_full_gate
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_full_gate_reports_boolean_name_violation() -> None:
|
|
5
|
+
content = "def check() -> None:\n enabled = True\n"
|
|
6
|
+
|
|
7
|
+
issues = validate_content_for_full_gate(content, "src/checks.py")
|
|
8
|
+
|
|
9
|
+
assert "Line 2: Boolean enabled - prefix with is_/has_/should_/can_/was_/did_" in issues
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
from code_rules_imports_logging import check_imports_at_top
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def test_import_inside_function_is_reported() -> None:
|
|
5
|
+
content = "import os\n\ndef check() -> None:\n import sys\n"
|
|
6
|
+
|
|
7
|
+
assert check_imports_at_top(content) == [
|
|
8
|
+
"Line 4: Import inside function - move to top of file"
|
|
9
|
+
]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from datetime import timedelta
|
|
2
|
+
|
|
3
|
+
from hooks_constants.usage_pace_constants import ALL_RATE_WINDOW_LENGTHS
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def test_usage_pace_windows_have_expected_lengths() -> None:
|
|
7
|
+
assert dict(ALL_RATE_WINDOW_LENGTHS) == {
|
|
8
|
+
"five_hour": timedelta(hours=5),
|
|
9
|
+
"seven_day": timedelta(days=7),
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import runpy
|
|
2
|
+
import sys
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def test_conftest_adds_routing_and_hooks_to_module_search_path(
|
|
9
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
10
|
+
) -> None:
|
|
11
|
+
routing_directory = Path(__file__).resolve().parent
|
|
12
|
+
hooks_directory = routing_directory.parent
|
|
13
|
+
expected_paths = [str(hooks_directory), str(routing_directory)]
|
|
14
|
+
monkeypatch.setattr(sys, "path", [path for path in sys.path if path not in expected_paths])
|
|
15
|
+
|
|
16
|
+
runpy.run_path(str(routing_directory / "conftest.py"))
|
|
17
|
+
|
|
18
|
+
assert sys.path[:2] == expected_paths
|