Skip to content

Split base_setup engine into focused modules #288

@codeforester

Description

@codeforester

Finding

The Python setup layer has become a broad orchestration module. cli/python/base_setup/engine.py is currently over 1,100 lines and carries a # pylint: disable=too-many-lines marker. It owns command dispatch, manifest action orchestration, Brewfile/mise checks, artifact checks and reconciliation, IDE install/extension/settings behavior, user IDE preference merging, process execution helpers, and project venv helpers in one file.

Concrete hotspots:

  • cli/python/base_setup/engine.py:3 disables too-many-lines.
  • reconcile_manifest starts at cli/python/base_setup/engine.py:159 and coordinates all setup domains.
  • IDE behavior spans roughly effective_ide_config, reconcile_ide_*, check_ide_*, and settings helpers from cli/python/base_setup/engine.py:487 through cli/python/base_setup/engine.py:999.
  • Generic artifact behavior resumes at cli/python/base_setup/engine.py:1001.

Proposed direction

Split the module by stable responsibility boundaries, for example:

  • base_setup.actions or base_setup.engine: command/action orchestration only.
  • base_setup.checks: ArtifactCheck, doctor/check rendering, common check helpers.
  • base_setup.artifacts: Homebrew and Python artifact reconcile/check behavior.
  • base_setup.delegates: Brewfile and mise path resolution plus reconcile/check behavior.
  • base_setup.ide: IDE definitions, effective config, install/extension/settings behavior.
  • base_setup.process: run_command, run_check, dry_run_command, format_command if those stay setup-specific.

Keep public behavior unchanged and preserve existing tests while moving code.

Acceptance criteria

  • cli/python/base_setup/engine.py no longer needs # pylint: disable=too-many-lines.
  • Each new module has a coherent ownership boundary and no circular imports.
  • Existing setup/check/doctor behavior is unchanged.
  • Existing Python tests and relevant BATS tests pass.

Parent audit: #287

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions