mago icon indicating copy to clipboard operation
mago copied to clipboard

Table Formatting Uses Print Width

Open rodnaph opened this issue 5 months ago • 0 comments

🐞 Describe the Bug

When formatting array data in a tabular way, the formatter seems to respect the configured print-width limit which will result in tables formatting poorly when they exceed this.

🔄 Steps to Reproduce

  1. Configure a print-width for the project
  2. Create tabular array data which exceeds the print-width
  3. Run mago fmt

⚙️ Configuration (mago.toml)

[formatter]
print-width = 100

📜 Command Output

mago fmt

📂 PHP Code Sample (If Applicable)

<?php

$data = [
  ['Policy #', 'Insured', 'Insured Accounting Address', 'Producer', 'Line(s) of Business', 'Carrier', 'Retail Agency', 'Policy Term', ''],
  [
    'DEF456',
    'Insured One DBA Some Other Business',
    'Address One, Address Two, Address Three, City, California, 90210',
    'User One',
    'Commercial Property',
    'Carrier One',
    'Agency One',
    '01/01/2012 - 07/02/2012',
    'Some Actions',
  ],
  [
    'ABC123',
    'Insured One DBA Some Other Business',
    'Address One, Address Two, Address Three, City, California, 90210',
    'User One',
    'General Liability',
    'Carrier One',
    'Agency One',
    '01/01/2012 - 07/02/2012',
    'Some Actions',
  ],
];

🖥️ Operating System

macOS

📦 How did you install Mago?

Homebrew (brew install mago)

📝 Additional Context

It was suggested I raise this as a defect in #215.

rodnaph avatar Sep 19 '25 16:09 rodnaph