Skip to content

Commit

Permalink
Merge pull request #2289 from recena/JENKINS-34438
Browse files Browse the repository at this point in the history
[JENKINS-34438] Activate JSHint during the build process
  • Loading branch information
daniel-beck committed May 3, 2016
2 parents 4927968 + ed21605 commit 134abbd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
13 changes: 13 additions & 0 deletions war/gulpfile.js
@@ -1,3 +1,6 @@
var gulp = require('gulp');
var jshint = require('gulp-jshint');

//
// See https://github.com/tfennelly/jenkins-js-builder
//
Expand Down Expand Up @@ -44,3 +47,13 @@ builder.bundle('src/main/js/add-item.js')
.withExternalModuleMapping('jquery-detached', 'core-assets/jquery-detached:jquery2')
.less('src/main/js/add-item.less')
.inDir('src/main/webapp/jsbundles');

//
// JSHint, a JavaScript Code Quality Tool
//
gulp.task('lint', function() {
return gulp.src('src/main/js/**/*.js')
.pipe(jshint())
.pipe(jshint.reporter('default'))
.pipe(jshint.reporter('fail'));
});
4 changes: 3 additions & 1 deletion war/package.json
Expand Up @@ -9,7 +9,9 @@
"hbsfy": "^2.4.1",
"jenkins-handlebars-rt": "^1.0.1",
"jenkins-js-builder": "0.0.40",
"jenkins-js-test": "^1.0.0"
"jenkins-js-test": "^1.0.0",
"jshint": "^2.9.2",
"gulp-jshint": "^2.0.0"
},
"dependencies": {
"bootstrap-detached": "^3.3.5-v1",
Expand Down
5 changes: 2 additions & 3 deletions war/pom.xml
Expand Up @@ -700,8 +700,7 @@ THE SOFTWARE.
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.23</version>

<version>1.0</version>
<executions>

<execution>
Expand Down Expand Up @@ -737,7 +736,7 @@ THE SOFTWARE.
<goal>gulp</goal>
</goals>
<configuration>
<arguments>bundle</arguments>
<arguments>lint bundle</arguments>
</configuration>
</execution>

Expand Down
2 changes: 1 addition & 1 deletion war/src/main/js/api/pluginManager.js
Expand Up @@ -185,7 +185,7 @@ exports.installPluginsDone = function(handler) {
handler.call({ isError: true, message: errorThrown });
}
});
}
};

/**
* Restart Jenkins
Expand Down
2 changes: 1 addition & 1 deletion war/src/main/js/pluginSetupWizardGui.js
Expand Up @@ -913,7 +913,7 @@ var createPluginSetupWizard = function(appendTarget) {
if (j.correlationId) {
selectedPluginNames.push(j.name);
}
setFailureStatus(j)
setFailureStatus(j);
}
showInstallProgress(data.state);
}));
Expand Down

0 comments on commit 134abbd

Please sign in to comment.