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

Truncate file names in gen_report #7

Merged
merged 2 commits into from
Sep 15, 2016

Conversation

wmonk
Copy link
Contributor

@wmonk wmonk commented Sep 15, 2016

I think this should fix the long filename issue. Rather than trying to mess with Istanbul internals, this will truncate the filenames as you are saving. Seems to be working for me, where it wasn't before.

@samccone
Copy link
Owner

Soooo I am partial to keeping the logic in the extension as dumb as possible due to the annoying complexity of testing it (and essentially writing code inside of an eval). The approach in the other PRs #2 #5 of patching filewriter seems to be an OK solution for me (so long as the solution works) :)

thoughts?

@wmonk
Copy link
Contributor Author

wmonk commented Sep 15, 2016

The other approach is to just move this logic into the gen_report.js script, and work out how to get the "new" code into Istanbul, maybe write to a tmp dir or something.

I think at the point FileWriter is being used, it's possibly too late?

@wmonk
Copy link
Contributor Author

wmonk commented Sep 15, 2016

Just re-read the gen_report code, and saw that you just read the file straight in. Guess if you stuck these changes in there, it'd be fine?

@samccone
Copy link
Owner

samccone commented Sep 15, 2016

I think at the point FileWriter is being used, it's possibly too late?

Hmm I see your point there is some interesting complexity here...

that you just read the file straight in. Guess if you stuck these changes in there, it'd be fine?

^ I am very much in favor of moving this complexity into gen_report 👍

@wmonk wmonk changed the title Truncate file names in extension Truncate file names in gen_report Sep 15, 2016
@wmonk
Copy link
Contributor Author

wmonk commented Sep 15, 2016

Pushed up now, seems to work fine.

var originals = JSON.parse(dump.originals)
var truncateFileNames = function (data) {
return Object.keys(data).reduce(function (n, path) {
console.log('Path', path);
Copy link
Owner

Choose a reason for hiding this comment

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

❌ log and we can land this ✈️

@samccone
Copy link
Owner

boom 1 tiny nit and we can land this! Thanks for dealing w/ the code review 👍 👏

@wmonk
Copy link
Contributor Author

wmonk commented Sep 15, 2016

Done!

@samccone samccone merged commit 713daf5 into samccone:master Sep 15, 2016
@paulirish
Copy link

tight.

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.

3 participants