[AUTO-GUARD] Misplaced imports in src/cleveragents/cli/main.py #6966

Closed
opened 2026-04-10 06:05:35 +00:00 by HAL9000 · 0 comments
Owner

The file src/cleveragents/cli/main.py contains numerous misplaced imports. The following import statements are inside functions and should be moved to the top of the file:

  • from rich.console import Console (Line 38)
  • from rich.console import Console (Line 48)
  • from cleveragents.cli.commands import (action, actor, audit, automation_profile, cleanup, config, context, invariant, lsp, plan, project, repo, resource, session, skill, tool, tui, validation) (Line 81)
  • from cleveragents.cli.commands.auto_debug import app as auto_debug_app (Line 102)
  • from cleveragents.cli.commands.db import app as db_app (Line 103)
  • from cleveragents.cli.commands.repl import _repl_app (Line 104)
  • from cleveragents.cli.commands.server import app as server_app (Line 105)
  • import traceback (Line 106)
  • from cleveragents.shared.redaction import set_show_secrets (Line 288)
  • from cleveragents.config.logging import configure_structlog (Line 326)
  • from cleveragents.cli.commands.system import (build_version_data, render_version_rich) and from cleveragents.cli.formatting import format_output (Line 342)
  • from cleveragents.cli.commands.system import build_info_data, render_info_rich and from cleveragents.cli.formatting import format_output (Line 363)
  • from cleveragents.config.logging import configure_structlog (Line 372)
  • from cleveragents.cli.commands.system import (build_diagnostics_data, render_diagnostics_rich) and from cleveragents.cli.formatting import format_output (Line 393)
  • from cleveragents.config.logging import configure_structlog (Line 403)
  • from cleveragents.cli.commands.project import init_command as project_init_command (Line 458)
  • from cleveragents.core.error_handling import classify_error (Line 470)
  • from cleveragents.core.error_handling import classify_error, wrap_unexpected (Line 482)
  • from cleveragents.cli.commands.plan import tell as plan_tell (Line 513)
  • from cleveragents.cli.commands.plan import build as plan_build (Line 543)
  • from cleveragents.cli.commands.plan import lifecycle_apply_plan (Line 561)
  • from cleveragents.cli.commands.context import context_add (Line 572)
  • from cleveragents.cli.commands.context import context_add (Line 583)
  • import subprocess (Line 612)
  • from cleveragents.cli.constants import EXIT_USAGE and from cleveragents.cli.errors import cli_error (Line 614)
  • import __main__ (Line 631)
  • from cleveragents.config.logging import configure_structlog (Line 684)
  • from cleveragents.core.error_handling import classify_error (Line 810)
  • from cleveragents.core.error_handling import classify_error, wrap_unexpected (Line 827)

Moving these imports to the top of the file will improve code readability and maintainability.


Automated by CleverAgents Bot
Supervisor: Architecture Guard | Agent: architecture-guard

The file `src/cleveragents/cli/main.py` contains numerous misplaced imports. The following import statements are inside functions and should be moved to the top of the file: - `from rich.console import Console` (Line 38) - `from rich.console import Console` (Line 48) - `from cleveragents.cli.commands import (action, actor, audit, automation_profile, cleanup, config, context, invariant, lsp, plan, project, repo, resource, session, skill, tool, tui, validation)` (Line 81) - `from cleveragents.cli.commands.auto_debug import app as auto_debug_app` (Line 102) - `from cleveragents.cli.commands.db import app as db_app` (Line 103) - `from cleveragents.cli.commands.repl import _repl_app` (Line 104) - `from cleveragents.cli.commands.server import app as server_app` (Line 105) - `import traceback` (Line 106) - `from cleveragents.shared.redaction import set_show_secrets` (Line 288) - `from cleveragents.config.logging import configure_structlog` (Line 326) - `from cleveragents.cli.commands.system import (build_version_data, render_version_rich)` and `from cleveragents.cli.formatting import format_output` (Line 342) - `from cleveragents.cli.commands.system import build_info_data, render_info_rich` and `from cleveragents.cli.formatting import format_output` (Line 363) - `from cleveragents.config.logging import configure_structlog` (Line 372) - `from cleveragents.cli.commands.system import (build_diagnostics_data, render_diagnostics_rich)` and `from cleveragents.cli.formatting import format_output` (Line 393) - `from cleveragents.config.logging import configure_structlog` (Line 403) - `from cleveragents.cli.commands.project import init_command as project_init_command` (Line 458) - `from cleveragents.core.error_handling import classify_error` (Line 470) - `from cleveragents.core.error_handling import classify_error, wrap_unexpected` (Line 482) - `from cleveragents.cli.commands.plan import tell as plan_tell` (Line 513) - `from cleveragents.cli.commands.plan import build as plan_build` (Line 543) - `from cleveragents.cli.commands.plan import lifecycle_apply_plan` (Line 561) - `from cleveragents.cli.commands.context import context_add` (Line 572) - `from cleveragents.cli.commands.context import context_add` (Line 583) - `import subprocess` (Line 612) - `from cleveragents.cli.constants import EXIT_USAGE` and `from cleveragents.cli.errors import cli_error` (Line 614) - `import __main__` (Line 631) - `from cleveragents.config.logging import configure_structlog` (Line 684) - `from cleveragents.core.error_handling import classify_error` (Line 810) - `from cleveragents.core.error_handling import classify_error, wrap_unexpected` (Line 827) Moving these imports to the top of the file will improve code readability and maintainability. --- **Automated by CleverAgents Bot** Supervisor: Architecture Guard | Agent: architecture-guard
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#6966
No description provided.