Repository navigation
refactor(cli): remove the _prepare_cmd alias and ban noqa F401 in src - #3110
Conversation
…sed-run-subprocess-re-import
|
Probe for tasks 2.1 to 2.4. The probe file 2.1 Count on the merged tree: 2.2 Base, ceiling 2.4 New ceiling After the probe file was deleted: The issue target (the |
Group 2 of the plan is done. A probe import with a noqa F401 passes the ratchet at ceiling 15 and fails it at ceiling 0. Archive the change.
|
Advisory pre-merge review (automated; a person decides). Recommendation: hold. The code change is correct, but the PR closes #2166 with one named criterion met in a different form, and no person has confirmed that form. Findings
Dropped or confirmed as no defect
Checks that were run
Not run: the full suite of about 128 files that use the process fake. CI covers it. |
🤖 I have created a release *beep* *boop* --- ## [0.40.0](v0.39.1...v0.40.0) (2026-11-02) ### Features * **k8s:** serve deepseek-v4.1-flash-1017 via OpenRouter ([#3145](#3145)) ([d5dc921](d5dc921)), closes [#3144](#3144) ### Bug Fixes * **cli:** stop with one error line in a removed working directory ([#3133](#3133)) ([c4a4dbb](c4a4dbb)) ### Code Refactoring * **cli:** remove the _prepare_cmd alias and ban noqa F401 in src ([#3110](#3110)) ([e40dbac](e40dbac)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
What
_prepare_cmd = prepare_tool_cmdfromsrc/devops_cli/core/process.py. The shared process fake andtests/core/test_process.pynow use the publicprepare_tool_cmd.src noqa: F401of the suppression ratchet to 0 intests/invariants/test_architectural_invariants.py.2166-the-unused-run-subprocess-re-import.Why
docs/TESTING.mdsays that no test imports a private name fromdevops_cli. The alias existed only for the fake and one test. The ratchet for# noqa: F401insrc/had a ceiling of 15, but the real count is 0. So 15 new unused re-imports could entersrc/with no failure.The re-import of
run_subprocessinsrc/devops_cli/security/ruff.pyis already gone onmain. Commit a195069 removed it, so this change needs no work for it.Proof
git grep -n "noqa: F401" -- srcprints nothing.uv run ruff check --select F401 --ignore-noqa srcprintsAll checks passed!.git grep -n "_prepare_cmd" -- src testsprints lines only intests/fixtures/roadmap_eval/. Those files are recorded eval data. No code uses the name.import os # noqa: F401in a new file undersrc/passes the ratchet at ceiling 15 and fails it at ceiling 0 withsrc noqa: F401: 1 > ceiling 0. The output is in the comment on this pull request.uv run devops ci teston the invariants test and the three process tests: 156 passed.uv run mypy --strict src/devops_cli/core/process.pypasses.Difference from the issue
The issue asks for a new
devops cirow that runsruff check --select F401 --ignore-noqaoversrc/. This change uses the suppression ratchet at ceiling 0 instead, and adds no row:lintrow, because the ruff selection holdsF(ruff checkon a file withimport osexits 1 withunused-import).# noqa: F401marker. The ratchet counts those markers insrc/and now fails on the first one (src noqa: F401: 1 > ceiling 0, shown in the comment of this pull request).The owner confirms this swap before the merge; criterion 3 of the issue changes with it.
Closes #2166