Skip to content

Conversation

vertti
Copy link
Owner

@vertti vertti commented Oct 6, 2025

This PR improves code quality by removing dead code, improving Python idioms, refactoring large functions, and enabling comprehensive linting with ALL ruff rules.

Changes Made

Remove Dead Code & Clutter

  • Removed 2 unused _build_task_feature_choices functions and their tests
  • Inlined _get_event_type_style helper
  • Removed decorative rocket emoji from welcome message (per CLAUDE.md)
  • Removed 5 obvious/redundant comments
  • Impact: -50 lines of dead code

More Pythonic Patterns

  • Simplified AWS client creation using ternary operator (4 functions)
  • Replaced nested list comprehension with readable for-loop in service/service.py:29-39
  • Removed unnecessary lambda wrapper in container/container.py:133
  • Impact: Clearer, more idiomatic Python

Better Code Organization

  • Extracted action mappings to module-level constants (_CONTAINER_ACTIONS, _TASK_ACTIONS)
  • Extracted change type display config to _CHANGE_TYPE_DISPLAY constant in task/ui.py
  • Reduced _handle_task_features from 35→13 lines
  • Impact: More maintainable, easier to extend

Improved Naming

  • _create_service_event → _parse_service_event (parsing vs creating)
  • _list_tasks_paginated → _list_tasks_by_status (more descriptive)
  • Updated corresponding test names
  • Impact: Clearer intent

Enable ALL Ruff Rules (~200+ Additional Checks)

  • Changed from 13 specific rules to ALL with sensible ignores
  • Auto-fixed 120 violations (trailing commas, import sorting, etc.)
  • Added ignores for 22 rules that don't fit CLI tool style
  • Fixed formatter conflict (COM812)
  • Impact: Comprehensive linting coverage

@vertti vertti merged commit bb1fde8 into main Oct 6, 2025
3 checks passed
@vertti vertti deleted the cleanup-refactoring branch October 6, 2025 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant