Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 29, 2025

This PR adds color coding to the FTA CLI table output to help users quickly identify code quality issues and improve overall readability.

Changes Made

The CLI table output now displays:

  • FTA Scores: Color-coded based on score ranges

    • 🟢 Green for scores ≤ 50 (good code quality)
    • 🟡 Yellow for scores 50-60 (moderate issues)
    • 🔴 Red for scores > 60 (needs improvement)
  • Assessment Messages: Matching colors for assessments

    • "OK" → Green
    • "Could be better" → Yellow
    • "Needs improvement" → Red
  • Headers: White color for clear section identification

  • File and Line Count columns: Grey color for visual hierarchy

Technical Implementation

  • Added colored crate dependency with optional feature flag
  • Enhanced comfy_table integration with proper ANSI color formatting
  • Implemented score-to-color mapping functions for consistent theming
  • Created backwards-compatible output function for testing
  • Removed force_no_tty() to enable color output in terminals

Example Output

CLI Color Output

The screenshot shows the new colored output with files of varying complexity levels, making it easy to spot which files need attention at a glance.

Testing

  • All existing tests continue to pass (57/57)
  • Added comprehensive color validation test
  • Manual testing verified across all FTA score ranges
  • Backwards compatibility maintained for non-color environments

This enhancement significantly improves the user experience by providing immediate visual feedback about code quality, making the FTA tool more actionable for developers.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add colour to CLI output</issue_title>
<issue_description>The CLI output should make higher FTA scores (and "Assessment" messages) increasingly red (on a scale from green (low fta score) -> red (high fta score)). Also, the headings should be white, and the "File" and "Num. Lines" columns slightly grey.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #270

💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI changed the title [WIP] Add colour to CLI output Add color support to CLI table output for better readability Sep 29, 2025
Copilot finished work on behalf of sgb-io September 29, 2025 19:17
Copilot AI requested a review from sgb-io September 29, 2025 19:17
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.

Add colour to CLI output

2 participants