mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-10 21:07:03 +01:00
353 -> 175 + 116 + 96. The print_* helpers, run_tool, check_tool and the
--help text move to lib/lint_output.sh; everything that runs after
--quick would have exited moves to lib/lint_full_tools.sh as
run_full_mode_linters. The output lib is sourced before argument parsing
because --help now calls usage() from it.
Verified on the path that actually contains the change: a full-mode run
diffed byte-identical against a detached worktree at the pre-split
commit, with pylint, flake8 and pycodestyle in the output proving the run
entered the extracted block. The --quick comparison is also identical but
exits before that block, so it alone would have proved little. The
failure path returns 1 on an unformatted file, confirming OVERALL_STATUS
still propagates out of the function.
Two shellcheck findings fixed rather than suppressed: SC2034 on
OVERALL_STATUS (the lib is analysed standalone, so the cross-seam
variables are now declared with a comment), and a pre-existing unquoted
`exit ${OVERALL_STATUS}` that the commit hook's stricter settings
surfaced. lint_python.sh was shfmt-clean before and still is.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011w2Pj4Ek3ZNMQVYcFHgXDY
20 lines
1.9 KiB
JSON
20 lines
1.9 KiB
JSON
{
|
|
"title": "Split meta/lint_python.sh under the 250-line cap",
|
|
"objective": "Bring meta/lint_python.sh (353 lines) under the repo-wide 250-line cap by moving its output helpers and its full-mode linter block into two sourced libs, with the entry script keeping configuration, argument parsing, the quick-mode tools and the summary.",
|
|
"acceptance_criteria": [
|
|
"bash ~/utils/scripts/check_file_length.sh reports no violation for meta/lint_python.sh or either new lib.",
|
|
"A full-mode run (no --quick) produces byte-identical output to the same run at the pre-split commit, with paths normalised -- and the run demonstrably enters the extracted block, evidenced by pylint, flake8 and pycodestyle appearing in the output.",
|
|
"A --quick run produces identical output and exit 0.",
|
|
"The failure path still exits 1: a deliberately unformatted Python file makes the script report failing tools and return non-zero, proving OVERALL_STATUS propagates out of the extracted function.",
|
|
"shellcheck -x on the entry and shellcheck on both libs exit 0 with no suppression added.",
|
|
"meta/lint_python.sh was shfmt-clean before the change and remains shfmt-clean after it."
|
|
],
|
|
"out_of_scope": [
|
|
"Adding, removing or reconfiguring any linter.",
|
|
"Changing flag semantics or the default target paths.",
|
|
"Reformatting the entry script's existing style.",
|
|
"Installing the optional linters (bandit, vulture, pydocstyle, radon, interrogate, pyright) that are absent on this machine."
|
|
],
|
|
"verifier": "bash meta/lint_python.sh scripts/check_requirements_sync.py (expects exit 0, 'All linting checks passed!', with pylint/flake8/pycodestyle among the passing tools), diffed against the same command run in a detached worktree at the pre-split commit; plus bash meta/lint_python.sh on an unformatted file expecting exit 1; plus shellcheck, shfmt -d and check_file_length.sh on all three files."
|
|
}
|