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

Move date.now and console.time audits to table formatter #1547

Merged
merged 2 commits into from
Jan 31, 2017
Merged

Conversation

ebidel
Copy link
Contributor

@ebidel ebidel commented Jan 26, 2017

R: all

This also ads the table heads to the pretty print output. The alignment is not great, but otherwise it's hard to know what the columns mean. Ideally, we'd bring in a CLI table formatter, but ...g3 :(

screen shot 2017-01-26 at 12 51 48 pm

@brendankenny
Copy link
Member

Ideally, we'd bring in a CLI table formatter, but ...g3

what about something simple like text-table with no deps and tiny in size.

case 'lineCol':
return `${result.line}:${result.col}`;
case 'isEval':
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a huge fan of accumulating audit-specific display logic here, do we anticipate isEval cropping up in several other places too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have a few JS audits that this is relevant for.

@patrickhulce
Copy link
Collaborator

thoughts on using URL.getDisplayName on those urls if they're not eval? would be nice to standardize there :)

@paulirish
Copy link
Member

what about something simple like text-table with no deps and tiny in size.

pretty good. here's their left-right align:

image

@ebidel
Copy link
Contributor Author

ebidel commented Jan 26, 2017

I'd like to prettify the pretty print in another PR, but don't we need a module that's checked in to g3?

@paulirish paulirish changed the title Move date.now and console.time audits to tale formatter Move date.now and console.time audits to table formatter Jan 26, 2017
@ebidel
Copy link
Contributor Author

ebidel commented Jan 26, 2017

There's https://github.com/75lb/table-layout

@ebidel
Copy link
Contributor Author

ebidel commented Jan 26, 2017

@patrickhulce should we URL.getDisplayName in the table formatter so everyone gets it and audits don't have to call it themselves?

@brendankenny
Copy link
Member

I'd like to prettify the pretty print in another PR, but don't we need a module that's checked in to g3?

New modules can be checked in, it's just a big responsibility..."we" have to own compat and maintenance. Since it has no dependencies it makes that a lot easier since it'll only be the addition of a single module.

@brendankenny
Copy link
Member

There's https://github.com/75lb/table-layout

yeah, there are a few with a lot more features, but e.g. table-layout brings in seven other modules in addition to itself. I guess it just depends on how much we need fancy table layout.

cli-table is another option, and only brings in colors, but the compatibility there is harder as it's fixed on 1.03, we already have ~0.6.3 from speedline, and the g3 version is 1.1.2. So someone will have to figure out what changes were made in that range and what incompatibilities exist as a result :)

@patrickhulce
Copy link
Collaborator

should we URL.getDisplayName in the table formatter so everyone gets it and audits don't have to call themselves?

I like it in theory, but there are some complexities with inline/previews we have to consider and I was going to suggest accepting a parameter for the base URL so that cross-origin hosts would be shown, since those weren't so obvious for me on a few runs which would complicate the formatter a bit. Either way let's save for another PR?

@ebidel
Copy link
Contributor Author

ebidel commented Jan 26, 2017

SG

@brendankenny
Copy link
Member

table formatter test bugs on travis

@ebidel
Copy link
Contributor Author

ebidel commented Jan 28, 2017

fixed tests!

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

LGTM

@brendankenny brendankenny merged commit c191238 into master Jan 31, 2017
@brendankenny brendankenny deleted the tables3 branch January 31, 2017 00:53
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.

None yet

4 participants