Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 2, 2025

This PR adds the ability to configure table styles for text table output, addressing a key limitation mentioned in the "Not Supported" section of the README.

What's New

Users can now customize the appearance of table output using five different styles from the jedib0t/go-pretty library:

  • default - ASCII characters (+, -, |) - compatible with all terminals
  • light - Unicode light box drawing characters (current default)
  • bold - Unicode bold box drawing characters
  • rounded - Unicode rounded corner characters
  • double - Unicode double line characters

Usage

Via CLI flag:

go-covercheck --table-style=bold coverage.out
go-covercheck --table-style=rounded --show-history

Via configuration file:

# .go-covercheck.yml
tableStyle: bold
statementThreshold: 70
blockThreshold: 50

Implementation Details

  • Added tableStyle field to Config struct with full YAML support
  • Added --table-style CLI flag with validation
  • Updated both coverage tables and history tables to respect the configuration
  • Table style is correctly ignored for non-table output formats (JSON, YAML, etc.)
  • Added comprehensive validation and error handling
  • Updated sample configuration file and documentation

Visual Examples

Bold style:

┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
┃       FILE       ┃    STATEMENTS   ┃   STATEMENT %   ┃
┣━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫
┃ main.go          ┃            5/10 ┃            50.0 ┃
┗━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┛

Rounded style:

╭──────────────────┬─────────────────┬─────────────────╮
│       FILE       │    STATEMENTS   │   STATEMENT %   │
├──────────────────┼─────────────────┼─────────────────┤
│ main.go          │            5/10 │            50.0 │
╰──────────────────┴─────────────────┴─────────────────╯

All existing functionality remains unchanged, and the feature gracefully degrades for terminals that don't support Unicode characters.

Fixes #42.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Feature: Add the ability to configure text table style feat: Add configurable table styles for coverage output Aug 2, 2025
Copilot AI requested a review from mach6 August 2, 2025 06:10
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.

Feature: Add the ability to configure text table style

2 participants