Skip to content

Commit c2d11d9

Browse files
authored
Merge pull request #519 from wking/travis-gulp-tests
.travis.yml: Add gulp validation
2 parents 0a2c8e2 + 3ddcfc9 commit c2d11d9

File tree

6 files changed

+22
-17
lines changed

6 files changed

+22
-17
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
.DS_Store
2-
# Ignore all hidden files/dirs except .gitignore
2+
# Ignore all hidden files/dirs except .gitignore and .travis.yml
33
.*
44
!/.gitignore
5+
!/.travis.yml
56

67
# nodeJS
78
node_modules/

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js:
3+
- "node"
4+
before_script:
5+
- npm run preinstall

gulpfile.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ function validate(file) {
3737
} else {
3838
errormsg = ' at line ' + error.line + ' ' + error.message;
3939
}
40-
console.log('Validation error(s) for file '+file+':'+error);
4140
});
4241
return new Error("File "+file+" "+errormsg);
4342
} else {
@@ -52,32 +51,31 @@ function validateall(callback) {
5251
return;
5352
}
5453
var error = null;
54+
var pass = 0, fail = 0;
5555
files.forEach(function(file) {
5656
var fileError = validate(file, fileError);
5757
if (fileError) {
58+
fail++;
5859
if (!error) {
5960
error = fileError;
6061
} else {
6162
// append the file in error
6263
error = new Error(error.message+fileError.message);
6364
}
65+
} else {
66+
pass++;
6467
}
6568
});
6669
if (error) {
6770
gutil.log(error.message);
6871
callback(error);
6972
}
73+
gutil.log('validation complete ' + pass + ' passed, ' + fail + ' failed');
7074
});
7175
}
7276

7377
gulp.task('validate', function(callback) {
7478
validateall(callback);
7579
});
7680

77-
// Comment the following out - just used for testing
78-
validateall(function(error) {
79-
if (error) {
80-
console.log(error.message);
81-
}
82-
});
83-
console.log('done');
81+
gulp.task('default', ['validate']);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"software"
2424
],
2525
"scripts": {
26-
"preinstall": "(npm list gulp -g || npm install gulp -g)"
26+
"preinstall": "(npm list gulp -g || npm install gulp -g)",
27+
"test": "gulp"
2728
},
2829
"dependencies": {
2930
"libxml-xsd": "0.5.2",

schema/ListedLicense.xsd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
<element name="alt" type="tns:altType"/>
3030
<element name="br" type="tns:emptyType"/>
3131
</choice>
32-
<attribute name="licenseId" type="string"/>
32+
<attribute name="licenseId" type="string" use="required" />
3333
<attribute name="isDeprecated" type="boolean"/>
34-
<attribute name="name" type="string"/>
34+
<attribute name="name" type="string" use="required" />
3535
<attribute name="listVersionAdded" type="string"/>
3636
<attribute name="deprecatedVersion" type="string"/>
3737
</complexType>
@@ -49,11 +49,11 @@
4949
<element name="alt" type="tns:altType"/>
5050
<element name="br" type="tns:emptyType"/>
5151
</choice>
52-
<attribute name="licenseId" type="string"/>
52+
<attribute name="licenseId" type="string" use="required" />
5353
<attribute name="isOsiApproved" type="boolean"/>
5454
<attribute name="isFsfLibre" type="boolean"/>
5555
<attribute name="isDeprecated" type="boolean"/>
56-
<attribute name="name" type="string"/>
56+
<attribute name="name" type="string" use="required" />
5757
<attribute name="listVersionAdded" type="string"/>
5858
<attribute name="deprecatedVersion" type="string"/>
5959
</complexType>
@@ -64,8 +64,8 @@
6464
</complexType>
6565
<complexType name="altType" mixed="true">
6666
<group ref="tns:formattedFixedTextGroup" minOccurs="0" maxOccurs="unbounded"/>
67-
<attribute name="name" type="string"/>
68-
<attribute name="match" type="string"/>
67+
<attribute name="name" type="string" use="required" />
68+
<attribute name="match" type="string" use="required" />
6969
</complexType>
7070
<complexType name="optionalType" mixed="true">
7171
<group ref="tns:formattedAltTextGroup" minOccurs="0" maxOccurs="unbounded"/>

src/ISC.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<crossRef>http://www.opensource.org/licenses/ISC</crossRef>
77
</crossRefs>
88
<titleText>
9-
<p><alt match="(The )?ISC License( \(ISC[L]?\))?:?">ISC License</alt></p>
9+
<p><alt name="title" match="(The )?ISC License( \(ISC[L]?\))?:?">ISC License</alt></p>
1010
</titleText>
1111
<copyrightText>
1212
<p>Copyright (c) <alt match=".+" name="copyright">2004-2010 by Internet Systems Consortium, Inc. ("ISC")

0 commit comments

Comments
 (0)