Skip to content

.travis.yml: Add gulp validation #519

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

Merged
merged 7 commits into from
Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
.DS_Store
# Ignore all hidden files/dirs except .gitignore
# Ignore all hidden files/dirs except .gitignore and .travis.yml
.*
!/.gitignore
!/.travis.yml

# nodeJS
node_modules/
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: node_js
node_js:
- "node"
before_script:
- npm run preinstall
14 changes: 6 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ function validate(file) {
} else {
errormsg = ' at line ' + error.line + ' ' + error.message;
}
console.log('Validation error(s) for file '+file+':'+error);
});
return new Error("File "+file+" "+errormsg);
} else {
Expand All @@ -52,32 +51,31 @@ function validateall(callback) {
return;
}
var error = null;
var pass = 0, fail = 0;
files.forEach(function(file) {
var fileError = validate(file, fileError);
if (fileError) {
fail++;
if (!error) {
error = fileError;
} else {
// append the file in error
error = new Error(error.message+fileError.message);
}
} else {
pass++;
}
});
if (error) {
gutil.log(error.message);
callback(error);
}
gutil.log('validation complete ' + pass + ' passed, ' + fail + ' failed');
});
}

gulp.task('validate', function(callback) {
validateall(callback);
});

// Comment the following out - just used for testing
validateall(function(error) {
if (error) {
console.log(error.message);
}
});
console.log('done');
gulp.task('default', ['validate']);
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"software"
],
"scripts": {
"preinstall": "(npm list gulp -g || npm install gulp -g)"
"preinstall": "(npm list gulp -g || npm install gulp -g)",
"test": "gulp"
},
"dependencies": {
"libxml-xsd": "0.5.2",
Expand Down
12 changes: 6 additions & 6 deletions schema/ListedLicense.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
<element name="alt" type="tns:altType"/>
<element name="br" type="tns:emptyType"/>
</choice>
<attribute name="licenseId" type="string"/>
<attribute name="licenseId" type="string" use="required" />
<attribute name="isDeprecated" type="boolean"/>
<attribute name="name" type="string"/>
<attribute name="name" type="string" use="required" />
<attribute name="listVersionAdded" type="string"/>
<attribute name="deprecatedVersion" type="string"/>
</complexType>
Expand All @@ -49,11 +49,11 @@
<element name="alt" type="tns:altType"/>
<element name="br" type="tns:emptyType"/>
</choice>
<attribute name="licenseId" type="string"/>
<attribute name="licenseId" type="string" use="required" />
<attribute name="isOsiApproved" type="boolean"/>
<attribute name="isFsfLibre" type="boolean"/>
<attribute name="isDeprecated" type="boolean"/>
<attribute name="name" type="string"/>
<attribute name="name" type="string" use="required" />
<attribute name="listVersionAdded" type="string"/>
<attribute name="deprecatedVersion" type="string"/>
</complexType>
Expand All @@ -64,8 +64,8 @@
</complexType>
<complexType name="altType" mixed="true">
<group ref="tns:formattedFixedTextGroup" minOccurs="0" maxOccurs="unbounded"/>
<attribute name="name" type="string"/>
<attribute name="match" type="string"/>
<attribute name="name" type="string" use="required" />
<attribute name="match" type="string" use="required" />
</complexType>
<complexType name="optionalType" mixed="true">
<group ref="tns:formattedAltTextGroup" minOccurs="0" maxOccurs="unbounded"/>
Expand Down
2 changes: 1 addition & 1 deletion src/ISC.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<crossRef>http://www.opensource.org/licenses/ISC</crossRef>
</crossRefs>
<titleText>
<p><alt match="(The )?ISC License( \(ISC[L]?\))?:?">ISC License</alt></p>
<p><alt name="title" match="(The )?ISC License( \(ISC[L]?\))?:?">ISC License</alt></p>
</titleText>
<copyrightText>
<p>Copyright (c) <alt match=".+" name="copyright">2004-2010 by Internet Systems Consortium, Inc. ("ISC")
Expand Down