-
Notifications
You must be signed in to change notification settings - Fork 69
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
Add validation for sprite2 and sprite3 files #39
Conversation
refactor schemas to support sprite2 and sprite3 files, while reusing rules in common with sb2 and sb3 files BREAKING CHANGE: Change to main API which now takes an additional boolean argument indicating whether a sprite or project is being validated
provide test coverage for sprite2 validation, and update sprite2_schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I like how you have split up the schema. Just one major comment, but otherwise I think this is 👍 .
* @param {Function} callback Returns error or project data | ||
*/ | ||
module.exports = function (input, callback) { | ||
module.exports = function (input, isSprite, callback) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
@@ -7,7 +7,7 @@ test('sb', function (t) { | |||
var set = data.sb; | |||
t.plan(set.length * 2); | |||
for (var i in data.sb) { | |||
parser(data.sb[i], function (err, res) { | |||
parser(data.sb[i], false, function (err, res) { |
This comment was marked as abuse.
This comment was marked as abuse.
Sorry, something went wrong.
Merging as per conversation in the comments/offline
🎉 This PR is included in version 4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Proposed Changes
Add support for .sprite2 and .sprite3 files (these aren't being created yet, so this PR does not include .sprite3 test fixtures). These changes include a refactor of the existing SB2 and SB3 validation such that:
Reason for Changes
scratchfoundation/scratch-gui#222
Test Coverage