diff --git a/.gitignore b/.gitignore index d14fffd..536fd73 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ tmp *.swp app/assets/css .sass-cache/ +out/ diff --git a/Gruntfile.js b/Gruntfile.js index 1f02afc..0317723 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,6 +1,10 @@ 'use strict'; -module.exports = function(grunt) { +module.exports = function (grunt) { + + grunt.loadNpmTasks('grunt-contrib-sass'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-jslint'); grunt.initConfig({ @@ -12,7 +16,6 @@ module.exports = function(grunt) { css: ['<%= project.assets %>/sass/app.scss'] }, - sass: { dev: { options: { @@ -20,7 +23,7 @@ module.exports = function(grunt) { compass: false }, files: { - '<%= project.assets %>/css/app.css':'<%= project.css %>' + '<%= project.assets %>/css/app.css' : '<%= project.css %>' } } }, @@ -32,41 +35,39 @@ module.exports = function(grunt) { } }, - jslint: { // configure the task + jslint: { // configure the task - client: { - src: [ - 'app/app.js', - 'app/**/*.js' - ], - exclude: [ - 'app/bower_components/**/*.js', - 'app/assets/**/*' - ], - directives: { // example directives - node: true, - todo: true - }, - options: { - edition: 'latest', // specify an edition of jslint or use 'dir/mycustom-jslint.js' for own path - junit: 'out/client-junit.xml', // write the output to a JUnit XML - log: 'out/client-lint.log', - jslintXml: 'out/client-jslint.xml', - errorsOnly: true, // only display errors - failOnError: false, // defaults to true - checkstyle: 'out/client-checkstyle.xml' // write a checkstyle-XML - } + client: { + src: [ + 'karma.conf.js', + 'Gruntfile.js', + 'app/app.js', + 'app/**/*.js' + ], + exclude: [ + 'app/bower_components/**/*.js', + 'app/assets/**/*' + ], + directives: { + node: true, + unparam: true, // TEMPORARY: Ignore unused params + predef: [ // Global variables + 'angular', 'inject', 'JustGage', + 'describe', 'beforeEach', 'it', 'expect' + ] + }, + options: { + edition: 'latest', // specify an edition of jslint or use 'dir/mycustom-jslint.js' for own path + junit: 'out/client-junit.xml', // write the output to a JUnit XML + log: 'out/client-lint.log', + jslintXml: 'out/client-jslint.xml', + errorsOnly: true, // only display errors + failOnError: false, // defaults to true + checkstyle: 'out/client-checkstyle.xml' // write a checkstyle-XML + } + } } - } }); - grunt.loadNpmTasks('grunt-contrib-sass'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-jslint'); - - grunt.registerTask('default', 'jslint'); - grunt.registerTask('default', [ - 'watch' - ]); - + grunt.registerTask('default', [ 'watch', 'jslint' ]); }; diff --git a/app/app.js b/app/app.js index 61a5cf8..f4deacf 100644 --- a/app/app.js +++ b/app/app.js @@ -1,4 +1,3 @@ -/*global angular*/ 'use strict'; angular.module('adagios', [ diff --git a/app/components/live/notifications.js b/app/components/live/notifications.js index 0e0802f..25f0ab2 100644 --- a/app/components/live/notifications.js +++ b/app/components/live/notifications.js @@ -1,4 +1,3 @@ -/*global angular*/ 'use strict'; angular.module('adagios.live', []) diff --git a/app/components/ng-justgage/ng-justgage.js b/app/components/ng-justgage/ng-justgage.js index e0a6c9c..e3a1530 100644 --- a/app/components/ng-justgage/ng-justgage.js +++ b/app/components/ng-justgage/ng-justgage.js @@ -1,4 +1,3 @@ -/*global angular, JustGage*/ 'use strict'; angular.module("ngJustGage", []) diff --git a/app/navbar/navbar.js b/app/navbar/navbar.js index 6d8cde2..89d634e 100644 --- a/app/navbar/navbar.js +++ b/app/navbar/navbar.js @@ -1,10 +1,9 @@ -/*global angular*/ 'use strict'; angular.module('adagios.navbar', ['adagios.live']) .controller('NavBarCtrl', ['$scope', '$http', 'GetProblems', function ($scope, $http, GetProblems) { - $scope.notifications = GetProblems; + $scope.notifications = GetProblems; }]) .directive('navbar', function () { diff --git a/app/navbar/navbar_test.js b/app/navbar/navbar_test.js index b690b53..078072a 100644 --- a/app/navbar/navbar_test.js +++ b/app/navbar/navbar_test.js @@ -1,4 +1,3 @@ -/*global describe, beforeEach, it, inject, expect*/ 'use strict'; describe('Navbar module', function () { diff --git a/app/sidebar/sidebar.js b/app/sidebar/sidebar.js index c7179bb..8c46e1a 100644 --- a/app/sidebar/sidebar.js +++ b/app/sidebar/sidebar.js @@ -1,10 +1,9 @@ -/*global angular*/ 'use strict'; angular.module('adagios.sidebar', []) .controller('SideBarCtrl', ['$scope', '$http', function ($scope, $http) { - + return; }]) .directive('sidebar', function () { diff --git a/app/sidebar/sidebar_test.js b/app/sidebar/sidebar_test.js index ec4f534..f56664b 100644 --- a/app/sidebar/sidebar_test.js +++ b/app/sidebar/sidebar_test.js @@ -1,4 +1,3 @@ -/*global describe, beforeEach, it, inject, expect*/ 'use strict'; describe('Sidebar module', function () { diff --git a/app/tactical/current_health/current_health.js b/app/tactical/current_health/current_health.js index ef8e2d2..8340e51 100644 --- a/app/tactical/current_health/current_health.js +++ b/app/tactical/current_health/current_health.js @@ -1,4 +1,3 @@ -/*global angular*/ 'use strict'; angular.module('adagios.tactical.current_health', ['ngRoute', 'ngJustGage' ]) diff --git a/app/tactical/current_health/current_health_test.js b/app/tactical/current_health/current_health_test.js index d6de352..7e3fe9c 100644 --- a/app/tactical/current_health/current_health_test.js +++ b/app/tactical/current_health/current_health_test.js @@ -1,4 +1,3 @@ -/*global describe, beforeEach, it, inject, expect*/ 'use strict'; describe('Current Health tactical submodule', function () { diff --git a/app/tactical/status_overview/status_overview.js b/app/tactical/status_overview/status_overview.js index e9593e2..596c8d5 100644 --- a/app/tactical/status_overview/status_overview.js +++ b/app/tactical/status_overview/status_overview.js @@ -1,4 +1,3 @@ -/*global angular*/ 'use strict'; angular.module('adagios.tactical.status_overview', ['ngRoute' ]) diff --git a/app/tactical/status_overview/status_overview_test.js b/app/tactical/status_overview/status_overview_test.js index 53f1261..28ca5d6 100644 --- a/app/tactical/status_overview/status_overview_test.js +++ b/app/tactical/status_overview/status_overview_test.js @@ -1,4 +1,3 @@ -/*global describe, beforeEach, it, inject, expect*/ 'use strict'; describe('Status Overview tactical submodule', function () { diff --git a/app/tactical/tactical.js b/app/tactical/tactical.js index 32d129f..a034283 100644 --- a/app/tactical/tactical.js +++ b/app/tactical/tactical.js @@ -1,4 +1,3 @@ -/*global angular*/ 'use strict'; angular.module('adagios.tactical', ['ngRoute', @@ -15,4 +14,5 @@ angular.module('adagios.tactical', ['ngRoute', }]) .controller('TacticalCtrl', ['$scope', '$http', function ($scope, $http) { + return; }]); diff --git a/app/tactical/tactical_test.js b/app/tactical/tactical_test.js index a6e7379..5cce4e1 100644 --- a/app/tactical/tactical_test.js +++ b/app/tactical/tactical_test.js @@ -1,4 +1,3 @@ -/*global describe, beforeEach, it, inject, expect*/ 'use strict'; describe('Tactical module', function () { diff --git a/app/tactical/top_alert_producers/top_alert_producers.js b/app/tactical/top_alert_producers/top_alert_producers.js index 0508f43..74d99ca 100644 --- a/app/tactical/top_alert_producers/top_alert_producers.js +++ b/app/tactical/top_alert_producers/top_alert_producers.js @@ -1,4 +1,3 @@ -/*global angular*/ 'use strict'; angular.module('adagios.tactical.top_alert_producers', ['ngRoute' ]) diff --git a/app/tactical/top_alert_producers/top_alert_producers_test.js b/app/tactical/top_alert_producers/top_alert_producers_test.js index 0340214..1118944 100644 --- a/app/tactical/top_alert_producers/top_alert_producers_test.js +++ b/app/tactical/top_alert_producers/top_alert_producers_test.js @@ -1,4 +1,3 @@ -/*global describe, beforeEach, it, inject, expect*/ 'use strict'; describe('Top Alert Producer tactical submodule', function () { diff --git a/karma.conf.js b/karma.conf.js index 70e7d37..df0fac5 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -1,35 +1,37 @@ -module.exports = function(config){ - config.set({ +'use strict'; - basePath : './', +module.exports = function (config) { + config.set({ - files : [ - 'app/bower_components/angular/angular.js', - 'app/bower_components/angular-route/angular-route.js', - 'app/bower_components/angular-mocks/angular-mocks.js', - 'app/components/**/*.js', - 'app/navbar/**/*.js', - 'app/sidebar/**/*.js', - 'app/tactical/**/*.js', - ], + basePath : './', - autoWatch : true, + files : [ + 'app/bower_components/angular/angular.js', + 'app/bower_components/angular-route/angular-route.js', + 'app/bower_components/angular-mocks/angular-mocks.js', + 'app/components/**/*.js', + 'app/navbar/**/*.js', + 'app/sidebar/**/*.js', + 'app/tactical/**/*.js' + ], - frameworks: ['jasmine'], + autoWatch : true, - browsers : ['Chrome'], + frameworks: ['jasmine'], - plugins : [ + browsers : ['Chrome'], + + plugins : [ 'karma-chrome-launcher', 'karma-firefox-launcher', 'karma-jasmine', 'karma-junit-reporter' - ], + ], - junitReporter : { - outputFile: 'test_out/unit.xml', - suite: 'unit' - } + junitReporter : { + outputFile: 'test_out/unit.xml', + suite: 'unit' + } - }); + }); };