Answer stability round 1: 1 🔴, 3 🟡 (0 misread); call project-config by its path in the README, pin the run-heavy breach, say who has the tools on PATH
CI / tests (pull_request) Has been cancelled
CI / tests (pull_request) Has been cancelled
This commit is contained in:
@@ -6,10 +6,14 @@ from repo_checks import ROOT
|
||||
|
||||
# A tool spelled by its place in an install folder, as opposed to a source file under bin/, which a reader opens by its path. A session the loop starts has the release's tools on PATH, so prose names a tool bare, and works wherever the release is installed.
|
||||
BY_ITS_FOLDER = re.compile(r"(?:~|\$HOME)/\.claude/bin/[\w.<>-]+(?![\w.<>/-])")
|
||||
# The files that record what was once so, which nobody runs a command from.
|
||||
HISTORY = ("CHANGELOG.md", "todo.md", "docs/")
|
||||
# README.md → Install links loop-claude and compress-archives from a shell and a crontab, which lack the tools, and says how to run any other tool there.
|
||||
INSTALL = {"~/.claude/bin/loop-claude", "$HOME/.claude/bin/compress-archives", "~/.claude/bin/<tool>"}
|
||||
# The plan, the changelog and the records: their text names a tool as it was spelled when the line was written, and nobody rewrites it.
|
||||
HISTORY = ("CHANGELOG.md", "docs/", "todo.md")
|
||||
# The lines a person runs in their own shell or a crontab, which lack the tools: only `loop-claude` is linked onto their `PATH`.
|
||||
BY_HAND = {
|
||||
"README.md": {"$HOME/.claude/bin/compress-archives", "~/.claude/bin/<tool>", "~/.claude/bin/loop-claude", "~/.claude/bin/notify", "~/.claude/bin/project-config"},
|
||||
"presentation/README.md": {"~/.claude/bin/run-heavy"},
|
||||
"presentation/build-pdf.py": {"~/.claude/bin/run-heavy"},
|
||||
}
|
||||
# settings.json names its hooks and its status line by their folder, and the test of the reviewer hook quotes it. Claude Code reads the file in every session, also one the human starts without the tools on PATH. A hook it cannot find doesn't refuse anything, so a bare name there would switch rule-hook off in that session.
|
||||
SETTINGS = ("settings.json", "bin/review_rules/test_reviewer_context.py")
|
||||
|
||||
@@ -24,7 +28,7 @@ class ToolsNamedBare(unittest.TestCase):
|
||||
if name.startswith(HISTORY) or name in SETTINGS or name == "bin/repo_checks/test_tools_named_bare.py" or not path.is_file():
|
||||
continue
|
||||
for number, line in enumerate(path.read_text(encoding="utf-8", errors="replace").splitlines(), 1):
|
||||
found += [f"{name}:{number}: {spelled}" for spelled in BY_ITS_FOLDER.findall(line) if not (name == "README.md" and spelled in INSTALL)]
|
||||
found += [f"{name}:{number}: {spelled}" for spelled in BY_ITS_FOLDER.findall(line) if spelled not in BY_HAND.get(name, ())]
|
||||
|
||||
self.assertEqual(found, [], "name each tool bare, as in `todo-item`")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user