Skip to content

Commit

Permalink
Merge pull request #43 from serv/chore/refactor-tests
Browse files Browse the repository at this point in the history
Added a linting task for gulp
  • Loading branch information
knsv committed Dec 10, 2014
2 parents 9aeff6b + 202af04 commit fcfbce8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
15 changes: 14 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ var rename = require('gulp-rename');
var istanbul = require('gulp-istanbul');
var bump = require('gulp-bump');
var tag_version = require('gulp-tag-version');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');

var paths = {
scripts: ['./src/*.js']
};

gulp.task('jison2', function() {
return gulp.src('./src/*.jison')
Expand Down Expand Up @@ -151,4 +157,11 @@ function inc(importance) {

gulp.task('patch', function() { return inc('patch'); })
gulp.task('feature', function() { return inc('minor'); })
gulp.task('release', function() { return inc('major'); })
gulp.task('release', function() { return inc('major'); })

// Using gulp-jshint and jshint-stylish
gulp.task('lint', function() {
return gulp.src(paths.scripts)
.pipe(jshint())
.pipe(jshint.reporter(stylish));
});
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"gulp-istanbul": "^0.4.0",
"gulp-jasmine": "~1.0.1",
"gulp-jison": "~1.0.0",
"gulp-jshint": "^1.9.0",
"gulp-less": "^1.3.6",
"gulp-rename": "~1.2.0",
"gulp-shell": "^0.2.10",
Expand All @@ -37,6 +38,7 @@
"he": "^0.5.0",
"jasmine": "~2.0.1",
"jison": "~0.4.15",
"jshint-stylish": "^1.0.0",
"karma": "~0.12.20",
"karma-chrome-launcher": "~0.1.5",
"karma-jasmine": "~0.2.1",
Expand Down
4 changes: 2 additions & 2 deletions src/graphDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ exports.addVertex = function (id, text, type, style) {
exports.addLink = function (start, end, type, linktext) {
//console.log('Got edge', start, end);
var edge = {start: start, end: end, type: undefined, text: ''};
var linktext = type.text;
linktext = type.text;

if (typeof linktext !== 'undefined') {
edge.text = linktext;
}
Expand Down Expand Up @@ -204,4 +205,3 @@ exports.clear = function () {
exports.defaultStyle = function () {
return "fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;";
};

2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ module.exports.detectType = function(text){
}

return "graph";
}
};

0 comments on commit fcfbce8

Please sign in to comment.