Skip to content

Not-detected ignored rules output wraps too much in wider terminals #162

@finwe

Description

@finwe

Until $terminalWidth - $maxHeaderWidth - 5 in ErrorsConsoleStyle results in a number < 0, the output is more or less fine, sometimes with overflown header separators.

the three dumped numbers are

var_dump($terminalWidth);
var_dump($maxHeaderWidth);
var_dump($terminalWidth - $maxHeaderWidth - 5);

just before the definition of $wrap function:

shot_170221_193946

When the subtraction gets bigger, the column gets upsizing itself right up from 1 character:

shot_170221_194016

Ultimately, there are some cases when the wrap is not run even on content larger than the terminal.

shot_170221_194332

The violations output seems fine in all cases.

I was able to solve this with a hacky && count($headers) > 1 in the condition on line 40:

if ($maxHeaderWidth === null || $length > $maxHeaderWidth && count($headers) > 1) {

I'll propose a PR if this "quickfix" is deemed plausible as it seems to me that the ConsoleStyle subclass doesn't take one-column tables in mind.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions