Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output list instead of table #5426

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

fregante
Copy link
Contributor

Before

This isn't even the full table, it doesn't fit on my screen

Screenshot 3

After

Screenshot 2

@fregante
Copy link
Contributor Author

fregante commented Jan 3, 2025

@rpl @willdurand I believe the improvements here are evident from my screenshots:

  • the output is shorter
  • there's no duplicate explanation
    Screenshot 3
  • there's no bad wrapping of long text
    Screenshot 2
  • paths are always clickable
    Screenshot 4
  • row and col are part of the path, meaning IDEs can reach them in the same click
    Screenshot
  • the table implementation isn't even right because the error/warning tables are not aligned
    Screenshot

The only reason not to move forward with this is because it already works, albeit in this suboptimal fashion. Since I'm currently available to work on this, allow me to complete this change and merge this PR. I don’t really like keeping PRs open for years

Copy link
Member

@Rob--W Rob--W left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for improving the readability and dropping one dependency. We're willing to switch the output format.

Could you adjust the text and update the tests so that they pass?

Thanks for this, and apologies for the review delay!

Comment on lines +183 to +187
const location = message.file
? `${message.file}${message.line ? `:${message.line}` : ''}${
message.column ? `:${message.column}` : ''
}`
: 'N/A';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you split this string construction in separate variables, so that there are no three ternary expressions embedded in one?

For example something like the following (untested, but just to show how it could be unrolled into something that is a bit more readable):

Suggested change
const location = message.file
? `${message.file}${message.line ? `:${message.line}` : ''}${
message.column ? `:${message.column}` : ''
}`
: 'N/A';
let location = message.file || 'N/A';
if (message.file && message.line) {
location += `:${message.line}`;
if (message.column) {
location += `:${message.column}`;
}
}

@fregante
Copy link
Contributor Author

Great, let's see if I have time this month

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.

Output as list, not table
3 participants