mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 20:07:04 +01:00
cli.py 345 -> 222 and _verifier.py 347 -> 228, via _cli_checks.py and _verifier_support.py. The cli seam cut straight through code covered by its per-file-ignores. Rather than copy S607 and PERF203 onto a second entry, both are fixed: systemctl is resolved with shutil.which, and the readiness poll no longer carries a try/except in its body now that the probe is its own function. Both ignores are deleted from meta/pyproject.toml and ruff passes without them - the repo has two fewer suppressions than before. The which() fix adds a systemctl-is-None branch, so the pass count goes 216 -> 217: one new test for it, no existing test touched. Coverage is back at 100% by covering the branch, not excluding it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
19 lines
2.0 KiB
JSON
19 lines
2.0 KiB
JSON
{
|
|
"title": "Split code_tutor cli.py and _verifier.py under the cap, removing two lint suppressions",
|
|
"objective": "Bring python_pkg/code_tutor/cli.py (345 lines) and _verifier.py (347) under the repo-wide 250-line cap. cli.py's split separated code covered by its per-file-ignores, so rather than copying S607 and PERF203 onto a second file the underlying lint is fixed and both entries are deleted.",
|
|
"acceptance_criteria": [
|
|
"cli.py, _cli_checks.py, _verifier.py and _verifier_support.py are each at most 250 lines.",
|
|
"The S607 and PERF203 entries are removed from meta/pyproject.toml's per-file-ignores for code_tutor/cli.py, and ruff passes on the result. The repo's total suppression count goes down by two; it must not go up.",
|
|
"The code_tutor suite reports 217 passing tests: the 216 baseline plus exactly one new test covering the shutil.which(\"systemctl\") is None branch that the S607 fix introduced.",
|
|
"The package keeps 100% branch coverage of the code_tutor source modules, with the new branch covered by a real test rather than an exclusion.",
|
|
"Every patch string is repointed per test by which function is under test: the _ensure_ollama_running and _ensure_fresh_plan tests move to _cli_checks, the analyze/study/status/drill command tests keep cli.",
|
|
"No existing assertion is changed and no test is deleted, skipped or weakened."
|
|
],
|
|
"out_of_scope": [
|
|
"Changing the observable behaviour of the Ollama startup path: it must still probe, start via systemctl, poll to the same timeout and print the same messages.",
|
|
"Removing the B008 ignore, which is the standard Typer dependency-injection pattern and stays with the command definitions in cli.py.",
|
|
"Splitting the code_tutor test modules, which are separate commits."
|
|
],
|
|
"verifier": "timeout 90 env PYTHONPATH=. python3 -m pytest python_pkg/code_tutor/tests -q (expects exactly 217 passed), plus pre-commit run ruff --files python_pkg/code_tutor/cli.py passing with the two ignores deleted, plus pre-commit run pytest-coverage confirming 100%."
|
|
}
|