Skip to content

Conversation

tofumatt
Copy link
Contributor

Internally flags all empty files inside addonMetadata without
throwing an error/raising any notices to the user, as requested
in #334.

src/validator.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we determine from size metadata in both the XPI + file system cases? I also wonder if we also need a check to see if a file is just whitespace 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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep yauzl iirc exposes unpacked size in the metadata object and the Directory class has just size which is from a stat object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tofumatt tofumatt force-pushed the flag-empty-files-334 branch from 81ac350 to 574bdef Compare November 30, 2015 18:24
@tofumatt
Copy link
Contributor Author

Using uncompressedSize now, should be a bit leaner/better!

src/validator.js Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

This API is different for the directory class [1].

Maybe we should add uncompressedSize as an alias? Either that or you need to check size too.

[1] https://github.com/mozilla/addons-validator/blob/master/src/io/utils.js#L21

Copy link
Contributor Author

@tofumatt tofumatt Dec 1, 2015 via email

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@tofumatt tofumatt Dec 1, 2015 via email

Choose a reason for hiding this comment

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

Internally flags all empty files inside addonMetadata without
throwing an error/raising any notices to the user, as requested
in #334.
@tofumatt
Copy link
Contributor Author

tofumatt commented Dec 1, 2015

Pushed again; should be all set now.

@muffinresearch
Copy link
Contributor

Lgtm. r+

tofumatt added a commit that referenced this pull request Dec 1, 2015
Flag empty files inside a package (fix #334)
@tofumatt tofumatt merged commit 37438d1 into master Dec 1, 2015
@tofumatt tofumatt deleted the flag-empty-files-334 branch December 1, 2015 14:57
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.

2 participants