claude-dev-env 1.44.0 → 1.46.0
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/CLAUDE.md +9 -0
- package/_shared/pr-loop/scripts/code_rules_gate.py +426 -85
- package/_shared/pr-loop/scripts/pr_loop_shared_constants/code_rules_gate_constants.py +20 -0
- package/_shared/pr-loop/scripts/pr_loop_shared_constants/reviews_disabled_constants.py +1 -0
- package/_shared/pr-loop/scripts/reviews_disabled.py +82 -9
- package/_shared/pr-loop/scripts/tests/test_code_rules_gate.py +630 -21
- package/_shared/pr-loop/scripts/tests/test_code_rules_gate_constants.py +15 -0
- package/_shared/pr-loop/scripts/tests/test_reviews_disabled.py +57 -0
- package/agents/clean-coder.md +7 -1
- package/agents/code-quality-agent.md +8 -5
- package/hooks/blocking/code_rules_enforcer.py +1562 -37
- package/hooks/blocking/content_search_zoekt_redirect_guidance.py +19 -0
- package/hooks/blocking/open_questions_in_plans_blocker.py +249 -0
- package/hooks/blocking/test_code_rules_enforcer.py +1389 -0
- package/hooks/blocking/test_code_rules_enforcer_banned_noun_word.py +292 -0
- package/hooks/blocking/test_code_rules_enforcer_cap_meta.py +46 -8
- package/hooks/blocking/test_code_rules_enforcer_exempt_marker_chained.py +189 -0
- package/hooks/blocking/test_code_rules_enforcer_function_length.py +210 -0
- package/hooks/blocking/test_code_rules_enforcer_tests_isolate_home_temp.py +1512 -0
- package/hooks/blocking/test_code_rules_enforcer_unused_imports.py +9 -5
- package/hooks/blocking/test_content_search_to_zoekt_redirector_unit.py +30 -0
- package/hooks/blocking/test_open_questions_in_plans_blocker.py +790 -0
- package/hooks/hooks.json +10 -0
- package/hooks/hooks_constants/banned_identifiers_constants.py +19 -0
- package/hooks/hooks_constants/code_rules_enforcer_constants.py +129 -2
- package/hooks/hooks_constants/open_questions_in_plans_blocker_constants.py +35 -0
- package/hooks/hooks_constants/test_open_questions_in_plans_blocker_constants.py +125 -0
- package/package.json +1 -1
- package/skills/_shared/pr-loop/scripts/_path_resolver.py +34 -13
- package/skills/_shared/pr-loop/scripts/init_loop_state.py +1 -2
- package/skills/_shared/pr-loop/scripts/teardown_worktrees.py +1 -4
- package/skills/_shared/pr-loop/scripts/test__path_resolver.py +57 -0
- package/skills/_shared/pr-loop/scripts/test_init_loop_state.py +48 -0
- package/skills/_shared/pr-loop/scripts/test_teardown_worktrees.py +59 -0
- package/skills/bugteam/PROMPTS.md +48 -12
- package/skills/bugteam/reference/team-setup.md +4 -2
- package/skills/bugteam/scripts/bugteam_code_rules_gate.py +487 -76
- package/skills/bugteam/scripts/bugteam_scripts_constants/bugteam_code_rules_gate_constants.py +22 -1
- package/skills/bugteam/scripts/test_bugteam_code_rules_gate.py +602 -12
- package/skills/pr-converge/SKILL.md +5 -0
- package/skills/pr-converge/reference/per-tick.md +14 -5
- package/skills/pr-converge/reference/state-schema.md +7 -3
- package/skills/pr-converge/scripts/check_convergence.py +27 -1
- package/skills/pr-converge/scripts/test_check_convergence.py +28 -0
|
@@ -7,9 +7,12 @@ rules and disabled-token taxonomy live in exactly one place.
|
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
|
+
import argparse
|
|
10
11
|
import os
|
|
12
|
+
import sys
|
|
11
13
|
|
|
12
14
|
from pr_loop_shared_constants.reviews_disabled_constants import (
|
|
15
|
+
CLAUDE_REVIEWS_DISABLED_BUGBOT_TOKEN,
|
|
13
16
|
CLAUDE_REVIEWS_DISABLED_BUGTEAM_TOKEN,
|
|
14
17
|
CLAUDE_REVIEWS_DISABLED_ENV_VAR_NAME,
|
|
15
18
|
CLAUDE_REVIEWS_DISABLED_TOKEN_SEPARATOR,
|
|
@@ -18,28 +21,98 @@ from pr_loop_shared_constants.reviews_disabled_constants import (
|
|
|
18
21
|
|
|
19
22
|
|
|
20
23
|
__all__ = [
|
|
24
|
+
"CLAUDE_REVIEWS_DISABLED_BUGBOT_TOKEN",
|
|
21
25
|
"CLAUDE_REVIEWS_DISABLED_BUGTEAM_TOKEN",
|
|
22
26
|
"CLAUDE_REVIEWS_DISABLED_ENV_VAR_NAME",
|
|
23
27
|
"CLAUDE_REVIEWS_DISABLED_TOKEN_SEPARATOR",
|
|
24
28
|
"EXIT_CODE_BUGTEAM_DISABLED_VIA_ENV",
|
|
29
|
+
"is_bugbot_disabled_via_env",
|
|
25
30
|
"is_bugteam_disabled_via_env",
|
|
31
|
+
"main",
|
|
26
32
|
]
|
|
27
33
|
|
|
28
34
|
|
|
29
|
-
def
|
|
30
|
-
"""Check whether CLAUDE_REVIEWS_DISABLED
|
|
35
|
+
def _is_reviewer_disabled_via_env(reviewer_token: str) -> bool:
|
|
36
|
+
"""Check whether CLAUDE_REVIEWS_DISABLED lists the given reviewer token.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
reviewer_token: The reviewer token to look for, already lowercase
|
|
40
|
+
(for example the bugteam or bugbot token constant).
|
|
31
41
|
|
|
32
42
|
Returns:
|
|
33
|
-
True when the env var contains
|
|
34
|
-
|
|
43
|
+
True when the env var contains ``reviewer_token`` as one of its
|
|
44
|
+
comma-separated entries (case-insensitive, whitespace-tolerant).
|
|
35
45
|
"""
|
|
36
|
-
reviews_disabled_env_var_name = CLAUDE_REVIEWS_DISABLED_ENV_VAR_NAME
|
|
37
46
|
reviews_disabled_token_separator = CLAUDE_REVIEWS_DISABLED_TOKEN_SEPARATOR
|
|
38
|
-
|
|
39
|
-
raw_value = os.environ.get(reviews_disabled_env_var_name, "")
|
|
47
|
+
disabled_reviewers_text = os.environ.get(CLAUDE_REVIEWS_DISABLED_ENV_VAR_NAME, "")
|
|
40
48
|
all_disabled_tokens = frozenset(
|
|
41
49
|
each_raw_token.strip().lower()
|
|
42
|
-
for each_raw_token in
|
|
50
|
+
for each_raw_token in disabled_reviewers_text.split(
|
|
51
|
+
reviews_disabled_token_separator
|
|
52
|
+
)
|
|
43
53
|
if each_raw_token.strip()
|
|
44
54
|
)
|
|
45
|
-
return
|
|
55
|
+
return reviewer_token in all_disabled_tokens
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def is_bugteam_disabled_via_env() -> bool:
|
|
59
|
+
"""Check whether CLAUDE_REVIEWS_DISABLED opts the bug-audit family out.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
True when the env var lists the ``bugteam`` token.
|
|
63
|
+
"""
|
|
64
|
+
return _is_reviewer_disabled_via_env(CLAUDE_REVIEWS_DISABLED_BUGTEAM_TOKEN)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def is_bugbot_disabled_via_env() -> bool:
|
|
68
|
+
"""Check whether CLAUDE_REVIEWS_DISABLED opts Cursor Bugbot out.
|
|
69
|
+
|
|
70
|
+
Returns:
|
|
71
|
+
True when the env var lists the ``bugbot`` token.
|
|
72
|
+
"""
|
|
73
|
+
return _is_reviewer_disabled_via_env(CLAUDE_REVIEWS_DISABLED_BUGBOT_TOKEN)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def parse_arguments(all_argv: list[str]) -> argparse.Namespace:
|
|
77
|
+
"""Parse command-line arguments for the reviewer opt-out check.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
all_argv: Argument list excluding the program name, typically
|
|
81
|
+
``sys.argv[1:]``.
|
|
82
|
+
|
|
83
|
+
Returns:
|
|
84
|
+
Namespace exposing a ``reviewer`` attribute constrained to the
|
|
85
|
+
known reviewer tokens.
|
|
86
|
+
"""
|
|
87
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
88
|
+
parser.add_argument(
|
|
89
|
+
"--reviewer",
|
|
90
|
+
required=True,
|
|
91
|
+
choices=[
|
|
92
|
+
CLAUDE_REVIEWS_DISABLED_BUGBOT_TOKEN,
|
|
93
|
+
CLAUDE_REVIEWS_DISABLED_BUGTEAM_TOKEN,
|
|
94
|
+
],
|
|
95
|
+
help="Reviewer token to test against CLAUDE_REVIEWS_DISABLED",
|
|
96
|
+
)
|
|
97
|
+
return parser.parse_args(all_argv)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def main(all_arguments: list[str]) -> int:
|
|
101
|
+
"""Exit 0 when the named reviewer is disabled via CLAUDE_REVIEWS_DISABLED.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
all_arguments: Argument list excluding the program name.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
0 when the named reviewer is opted out by the env var, 1 otherwise.
|
|
108
|
+
"""
|
|
109
|
+
arguments = parse_arguments(all_arguments)
|
|
110
|
+
disabled_checker_by_reviewer = {
|
|
111
|
+
CLAUDE_REVIEWS_DISABLED_BUGBOT_TOKEN: is_bugbot_disabled_via_env,
|
|
112
|
+
CLAUDE_REVIEWS_DISABLED_BUGTEAM_TOKEN: is_bugteam_disabled_via_env,
|
|
113
|
+
}
|
|
114
|
+
return 0 if disabled_checker_by_reviewer[arguments.reviewer]() else 1
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
if __name__ == "__main__":
|
|
118
|
+
raise SystemExit(main(sys.argv[1:]))
|