Dead code sweep (Python): legacy phase-based hook engine, tests-only helpers, unused --no-config-propose flag

Aperta
#39 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend, cli, testing

Direzione di ricerca

Start by reading core/environment/execution.py and the listed test callers to confirm the hook engine is test-only. Remove the dead functions from core/config/loader.py, utils/network.py, core/processing/* and others, plus the --no-config-propose flag in app.py. Migrate tests off profiles/config.py shim and delete temp_test/; run the suite to confirm no references remain and tests pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

code-quality tech-debt

Verified production-dead (grep across src/ + tests/; "tests-only" = kept alive only by tests and re-exports):

Decide: legacy phase-based hook engine. core/environment/execution.py (parse_hook_entries, run_blocking_hook, spawn_background_hook, run_hooks_for_file, HookOutcome), HookSpec (core/config/models.py:96-116), HookEntry (core/config/schema.py:61-67, labelled "legacy phase-based"). Only callers are tests/core/environment/test_execution.py + re-exports (environment/__init__.py:11-16, core/__init__.py:46-47). Production uses the step-based run_workflow. Delete now, or batch with the gui/ removal (phase-2 tracking issue).

Certain production-dead functions (drop, plus their tests):

  • propose_config_creation — core/config/loader.py:46-89 (superseded by launch/creation.propose_creation + --init)
  • load_column_rules_from_config — core/processing/column_extractor.py:256 (parses a legacy COLUMN_DEFINITIONS string format nothing produces anymore)
  • get_system_info — utils/network.py:65-76 (duplicate of core/environment/system.collect_system_info)
  • list_directory_paths — utils/file_utils.py:481-490
  • log_rotated — core/telemetry/events.py:67 (diagnostics.py:116 emits the same event directly — one mechanism should win)
  • get_file_info_dynamic — core/processing/file_classifier.py:176
  • ScanMetrics.to_dict — core/telemetry/metrics.py:32-41 (zero callers anywhere)

CLI/config leftovers

  • --no-config-propose flag stored (app.py:605-610, :110) but never read — the comment at app.py:252-255 admits the behavior moved.
  • AppConfig.skip_config_prompt (models.py:280) read only by gui/ — dies with the gui removal.

Test-side orphans

  • profiles/config.py shim imported only by tests — migrate tests to real module paths and delete.
  • Unused conftest fixtures sample_config_path / empty_config_path (tests/conftest.py:17-57).
  • Registered marker qt_no_exception_capture (pyproject.toml:218-220) but pytest-qt is not a dependency anywhere — remove the marker, or add the dep.
  • Tracked scratch file temp_test/web/package.json — git rm the whole temp_test/ directory.
  • tests/core/config/test_models_refactored.py, test_reader_refactored.py, tests/core/processing/test_column_extractor_refactored.py sit next to their originals — merge or delete the leftovers.

Note: the 14 gui-only telemetry helpers (app_closed, filter_changed, …) are intentionally not in this list — they die with the gui/ phase-2 removal.

Lingua principale
Python
Stelle
1
Fork
1
Merge medio
4h 46m
PR unite (30g)
55

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di falbany/ProFiles

Tutte le issue di falbany/ProFiles

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.