feat: cli remove validate, absorb batch into run --batch - #440
Merged
Conversation
Rimosso `toolkit validate` (coperto da run --dry-run). Assorbito `toolkit batch` in `toolkit run --batch <file>`. Aggiunto smoke/batch.txt con smoke test offline. Backward compat: batch come comando hidden + deprecation warning. - toolkit/cli/cmd_validate.py eliminato - toolkit/cli/cmd_run.py: _run_batch(), flag --batch, helper condivisi - toolkit/cli/cmd_batch.py: thin wrapper deprecato (272 -> 65 righe) - toolkit/cli/app.py: remove validate registration - smoke/batch.txt: batch list per smoke offline - Test: aggiornati per validate rimosso e run --batch - Nuovo test: test_run_batch_end_to_end (@pytest.mark.contract) Bilancio: -32 netto righe, 116 test passano, ruff OK
I 6 helper di formattazione e silenziamento (format_years, format_duration, print_table, build_row, silence_typer_echo, silence_logger) erano in cmd_run.py, ingrossandolo di ~60 righe. Estratti in toolkit/cli/_batch_helpers.py, importati da cmd_run.py. Riduce cmd_run.py di ~60 righe, mantiene separazione netta.
- Fix tabella CLI in README.md (|---|---|---| -> | |) - Aggiungi run --batch alla tabella comandi - feature-stability.md: validate all -> run --batch - Smoke README: inspect summary -> inspect, run all/full -> run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sintesi
Rimosso
toolkit validate(coperto darun --dry-run+ validazione interna).Assorbito
toolkit batchintoolkit run --batch <file>.Aggiunto
smoke/batch.txtcon smoke test offline.Contesto collegato
Non ci sono issue collegate — Fase 1 del refactor CLI discusso in chat dopo il merge della PR #439.
Cosa cambia
Impatto su contratti pubblici
dataset.yml(nuovo campo, cambio obbligatorietà)Verifica
pytest tests/test_batch_cli.py tests/test_cmd_batch.py tests/test_dataset_loader.py tests/test_cli_path_contract.py tests/test_smoke_templates_contract_years.py tests/test_smoke_templates_golden_path.py -x --tb=short -q ruff check .pytest -m corepassaruff check .passamypy toolkit/passa (2 errori preesistenti in read_excel.py e profile/raw.py, non toccati)contract)Checklist PR
rge lasciato shim backward compat con
DeprecationWarningMetriche (root-cause-change)
Tipo: cleanup reale + contract alignment
Problema reale:
validateebatchduplicavano funzionalità già inrunContratto riusato/sostituito:
_run_batch()incmd_run.pyassorbe la logica batch;run --dry-runcopre già la validazione che facevavalidateCodice rimosso o duplicazione eliminata:
cmd_validate.pyeliminato (110 righe)cmd_batch.pyda 272 a 65 righe (thin wrapper deprecato)Test aggiunti:
test_run_batch_end_to_end(@pytest.mark.contract)Rischio residuo:
batchcomando hidden esiste ancora come backward compat;utenti che usano
toolkit validatein script devono passare atoolkit run --dry-runFollow-up obbligatorio: Fase 2 (assorbire
contractininspect --contract)Note per chi revisiona
Il grosso del refactor è in:
toolkit/cli/cmd_run.py: nuovo_run_batch()+ helper batch condivisitoolkit/cli/cmd_batch.py: riscritto come thin wrapper deprecatotoolkit/cli/cmd_validate.py: eliminatosmoke/batch.txt: batch list per smoke offlinevalidateo importavano dacmd_validate