Apply Jshint to files

This commit is contained in:
Vincent Fournier 2015-05-04 10:13:18 -04:00
parent 5f4f119e6c
commit e9932e47c2
7 changed files with 37 additions and 25 deletions

View File

@ -78,10 +78,19 @@ module.exports = function (grunt) {
jshint: { // configure the task
options: {
node: true,
loopfunc: true,
globals: {
document: true,
angular: true,
jQuery: true
},
jQuery: true,
$: true,
describe: true,
it: true,
expect: true,
beforeEach: true,
inject: true
},
force: true
},
all: [
@ -89,7 +98,9 @@ module.exports = function (grunt) {
'Gruntfile.js',
'<%= project.app %>/app.js',
'<%= project.app %>/**/*.js',
'!<%= project.app %>/bower_components/**'
'!<%= project.app %>/bower_components/**',
'!<%= project.app %>/**/live.js',
'!<%= project.app %>/**/adagios.js'
]
},
@ -130,7 +141,7 @@ module.exports = function (grunt) {
'<%= project.app %>/components/live/adagios.js',
'<%= project.assets %>/sass/{,*/}*.{scss,sass}'
],
tasks: ['copy:adagios', 'sass:dev']
tasks: ['copy:adagios', 'sass:dev', 'jshint:all']
},
surveil: {
files: [
@ -139,7 +150,7 @@ module.exports = function (grunt) {
'<%= project.app %>/components/live/surveil.js',
'<%= project.assets %>/sass/{,*/}*.{scss,sass}'
],
tasks: ['copy:surveil', 'sass:dev']
tasks: ['copy:surveil', 'sass:dev', 'jshint:all']
},
options: {
livereload: true

View File

@ -1,3 +1,4 @@
/*global moment */
'use strict';
angular.module('bansho.filters', [])

View File

@ -25,7 +25,7 @@ angular.module('bansho.live', [])
defaults = angular.isArray(defaults) ? defaults : [defaults];
return defaults.concat(transform);
};
}
if (apiName === 'hosts') {
transformations = hostMiddleware;
@ -111,7 +111,7 @@ angular.module('bansho.live', [])
});
return responsePromise.promise;
}
};
var getHostProblems = function () {
var fields = ['state'],
@ -136,7 +136,7 @@ angular.module('bansho.live', [])
.error(function () {
throw new Error('getServiceOpenProblems : POST Request failed');
});
}
};
// This service is used to count the number of hosts
var getTotalHosts = function () {
@ -149,7 +149,7 @@ angular.module('bansho.live', [])
.error(function () {
throw new Error('getTotalHosts : POST Request failed');
});
}
};
// This service is used to count the number of services
var getTotalServices = function () {
@ -162,7 +162,7 @@ angular.module('bansho.live', [])
.error(function () {
throw new Error('getTotalServices : POST Request failed');
});
}
};
var getHost = function (objectType, objectIdentifier) {
var objectData = {},
@ -179,11 +179,11 @@ angular.module('bansho.live', [])
objectData.live = liveData;
objectData.config = configData;
responsePromise.resolve(objectData);
})
});
});
return responsePromise.promise;
}
};
var hostQueryTransform = function (fields, filters) {
var i,
@ -196,7 +196,7 @@ angular.module('bansho.live', [])
fields[i] = transformations[fields[i]];
}
}
}
};
// Modify response object to conform to web ui
var hostMiddleware = function (data) {
@ -215,7 +215,7 @@ angular.module('bansho.live', [])
}
return data;
}
};
// Modify response object to conform to web ui
var serviceMiddleware = function (data) {
@ -285,7 +285,7 @@ angular.module('bansho.live', [])
} else {
serviceAdditionnalFields[field] = value;
}
})
});
angular.forEach(filters, function (filterData, filterName) {
angular.forEach(filterData, function (values, field) {
@ -335,7 +335,7 @@ angular.module('bansho.live', [])
});
return responsePromise.promise;
}
};
var acknowledge = function (host_name, service_description, attrs) {
var data = {};

View File

@ -1,3 +1,4 @@
/*global JustGage */
'use strict';
angular.module("ngJustGage", [])

View File

@ -36,13 +36,13 @@ angular.module('bansho.table.actionbar', ['bansho.table', 'bansho.live'])
$scope.isAcknowledgeShown = false;
$scope.isDowntimeShown = !$scope.isDowntimeShown;
}
};
$scope.switchAcknowledgeForm = function () {
$scope.isDowntimeShown = false;
$scope.isAcknowledgeShown = !$scope.isAcknowledgeShown;
}
};
$scope.actionbarFilters = actionbarFilters;
$scope.actionbarFilters.activeFilter = $scope.actionbarFilters.possibleFilters[0];

View File

@ -19,7 +19,7 @@ angular.module('bansho.table.actionbar')
actionbarFilters.searchFilter);
angular.forEach(entries, function (entry) {
var service_description = undefined;
var service_description;
if (entry.is_checked) {
if ('description' in entry) {
@ -34,7 +34,7 @@ angular.module('bansho.table.actionbar')
});
};
}
}
};
}])
.directive('banshoDowntimeForm',
@ -55,7 +55,7 @@ angular.module('bansho.table.actionbar')
var entries = $filter('filter')(table.entries, actionbarFilters.searchFilter);
angular.forEach(entries, function (entry) {
var service_description = undefined;
var service_description;
if (entry.is_checked) {
if ('description' in entry) {
@ -78,7 +78,7 @@ angular.module('bansho.table.actionbar')
}
});
});
}
};
}
}
};
}]);

View File

@ -76,8 +76,7 @@ angular.module('bansho.table', ['bansho.live',
conf;
if (!attrs.cellsText || !attrs.cellsName || !attrs.apiName || !attrs.isWrappable) {
throw new Error('<bansho-table> "cells-text", "cells-name", "api-name"'
+ ' and "is-wrappable" attributes must be defined');
throw new Error('<bansho-table> "cells-text", "cells-name", "api-name" and "is-wrappable" attributes must be defined');
}
tablesConfig[attrs.tableId] = {};