From e53a3393a2783ec878d3f9c2e55997d42a98458d Mon Sep 17 00:00:00 2001 From: William Lachance Date: Mon, 5 Jun 2017 11:36:32 -0400 Subject: [PATCH] Bug 1369122 - Enable eslint comma-spacing rule (#2522) --- neutrino-custom/lint.js | 1 + ui/js/controllers/admin/admin.js | 2 +- ui/js/controllers/bugfiler.js | 2 +- ui/js/controllers/perf/alerts.js | 6 +++--- ui/js/controllers/perf/compare.js | 8 ++++---- ui/js/controllers/perf/graphs.js | 4 ++-- ui/js/models/exclusion_profile.js | 8 ++++---- ui/js/models/job.js | 2 +- ui/js/models/job_exclusion.js | 6 +++--- ui/js/models/job_type.js | 2 +- ui/js/models/resultsets_store.js | 2 +- ui/js/models/user.js | 2 +- ui/partials/perf/comparechooserctrl.html | 5 +++-- ui/plugins/controller.js | 2 +- ui/plugins/failure_summary/controller.js | 2 +- ui/plugins/pinboard.js | 4 ++-- ui/plugins/similar_jobs/controller.js | 2 +- 17 files changed, 31 insertions(+), 29 deletions(-) diff --git a/neutrino-custom/lint.js b/neutrino-custom/lint.js index f638541c0..7c0aeee86 100644 --- a/neutrino-custom/lint.js +++ b/neutrino-custom/lint.js @@ -28,6 +28,7 @@ module.exports = neutrino => { extends: 'eslint:recommended', rules: { 'accessor-pairs': 'error', + 'comma-spacing': 'error', 'comma-style': 'error', 'eol-last': 'error', 'eqeqeq': 'error', diff --git a/ui/js/controllers/admin/admin.js b/ui/js/controllers/admin/admin.js index e1d7b34c9..989b49ade 100644 --- a/ui/js/controllers/admin/admin.js +++ b/ui/js/controllers/admin/admin.js @@ -3,7 +3,7 @@ admin.controller('AdminCtrl', [ '$scope', 'ThBuildPlatformModel', 'ThJobTypeModel', 'ThRepositoryModel', 'ThOptionCollectionModel', 'ThJobExclusionModel', '$state', - '$q','ThExclusionProfileModel', + '$q', 'ThExclusionProfileModel', function AdminCtrl( $scope, ThBuildPlatformModel, ThJobTypeModel, ThRepositoryModel, ThOptionCollectionModel, ThJobExclusionModel, $state, diff --git a/ui/js/controllers/bugfiler.js b/ui/js/controllers/bugfiler.js index 2fc5fc857..a539ab7a3 100644 --- a/ui/js/controllers/bugfiler.js +++ b/ui/js/controllers/bugfiler.js @@ -405,7 +405,7 @@ treeherder.controller('BugFilerCtrl', [ * Disable or enable form elements as needed at various points in the submission process */ $scope.toggleForm = function (disabled) { - $(':input','#modalForm').attr("disabled", disabled); + $(':input', '#modalForm').attr("disabled", disabled); }; } ]); diff --git a/ui/js/controllers/perf/alerts.js b/ui/js/controllers/perf/alerts.js index 91b6c7c9d..61b362085 100644 --- a/ui/js/controllers/perf/alerts.js +++ b/ui/js/controllers/perf/alerts.js @@ -7,7 +7,7 @@ perf.factory('PhBugs', [ fileBug: function (alertSummary) { $http.get(thServiceDomain + '/api/performance/bug-template/?framework=' + alertSummary.framework).then(function (response) { var template = response.data[0]; - var repo = _.find($rootScope.repos,{ name: alertSummary.repository }); + var repo = _.find($rootScope.repos, { name: alertSummary.repository }); var compiledText = $interpolate(template.text)({ revisionHref: repo.getPushLogHref(alertSummary.resultSetMetadata.revision), alertHref: window.location.origin + '/perf.html#/alerts?id=' + @@ -103,8 +103,8 @@ perf.controller( perf.controller( 'ReassignAlertsCtrl', ['$scope', '$uibModalInstance', '$http', '$q', 'alertSummary', - 'allAlertSummaries','PhAlerts', 'phAlertStatusMap', - function ($scope, $uibModalInstance,$http, $q, alertSummary, allAlertSummaries, PhAlerts, phAlertStatusMap) { + 'allAlertSummaries', 'PhAlerts', 'phAlertStatusMap', + function ($scope, $uibModalInstance, $http, $q, alertSummary, allAlertSummaries, PhAlerts, phAlertStatusMap) { $scope.title = "Reassign alerts"; $scope.placeholder = "Alert #"; diff --git a/ui/js/controllers/perf/compare.js b/ui/js/controllers/perf/compare.js index f072d51f8..88a9eb978 100644 --- a/ui/js/controllers/perf/compare.js +++ b/ui/js/controllers/perf/compare.js @@ -1,9 +1,9 @@ "use strict"; perf.controller('CompareChooserCtrl', [ - '$state', '$stateParams', '$scope','$q', 'ThRepositoryModel', 'ThResultSetModel', + '$state', '$stateParams', '$scope', '$q', 'ThRepositoryModel', 'ThResultSetModel', 'phCompareDefaultNewRepo', 'phCompareDefaultOriginalRepo', 'JsonPushes', - 'thPerformanceBranches','localStorageService', 'compareBaseLineDefaultTimeRange', + 'thPerformanceBranches', 'localStorageService', 'compareBaseLineDefaultTimeRange', function CompareChooserCtrl($state, $stateParams, $scope, $q, ThRepositoryModel, ThResultSetModel, phCompareDefaultNewRepo, @@ -180,8 +180,8 @@ perf.controller('CompareChooserCtrl', [ perf.controller('CompareResultsCtrl', [ '$state', '$stateParams', '$scope', '$rootScope', '$location', 'thServiceDomain', 'ThRepositoryModel', - 'ThResultSetModel', '$http', '$httpParamSerializer','$q', '$timeout', 'PhFramework', 'PhSeries', - 'math', 'phTimeRanges', 'PhCompare','compareBaseLineDefaultTimeRange', + 'ThResultSetModel', '$http', '$httpParamSerializer', '$q', '$timeout', 'PhFramework', 'PhSeries', + 'math', 'phTimeRanges', 'PhCompare', 'compareBaseLineDefaultTimeRange', function CompareResultsCtrl($state, $stateParams, $scope, $rootScope, $location, thServiceDomain, diff --git a/ui/js/controllers/perf/graphs.js b/ui/js/controllers/perf/graphs.js index a0e48d7fe..1ddb47dc6 100644 --- a/ui/js/controllers/perf/graphs.js +++ b/ui/js/controllers/perf/graphs.js @@ -744,8 +744,8 @@ perf.controller('GraphsCtrl', [ var zoomString = decodeURIComponent($stateParams.zoom).replace(/[\[\{\}\]"]+/g, ''); var zoomArray = zoomString.split(","); var zoomObject = { - "x": zoomArray.slice(0,2), - "y": zoomArray.slice(2,4) + "x": zoomArray.slice(0, 2), + "y": zoomArray.slice(2, 4) }; $scope.zoom = (zoomString) ? zoomObject : []; } else { diff --git a/ui/js/models/exclusion_profile.js b/ui/js/models/exclusion_profile.js index a8fc155b4..c47f7d907 100644 --- a/ui/js/models/exclusion_profile.js +++ b/ui/js/models/exclusion_profile.js @@ -21,7 +21,7 @@ treeherder.factory('ThExclusionProfileModel', [ options = options || {}; cache = cache || false; var query_string = $.param(options); - return $http.get(ThExclusionProfileModel.get_uri()+"?"+query_string,{ + return $http.get(ThExclusionProfileModel.get_uri()+"?"+query_string, { cache: cache }) .then(function (response) { @@ -60,7 +60,7 @@ treeherder.factory('ThExclusionProfileModel', [ } else if (reason.data && reason.data.detail) { thNotify.send(reason.data.detail, "danger"); } else { - thNotify.send("Error","danger"); + thNotify.send("Error", "danger"); $log.error(reason); } return $q.reject(reason); @@ -87,7 +87,7 @@ treeherder.factory('ThExclusionProfileModel', [ }); }); } else { - thNotify.send(reason,"danger"); + thNotify.send(reason, "danger"); } return $q.reject(reason); } @@ -104,7 +104,7 @@ treeherder.factory('ThExclusionProfileModel', [ thNotify.send("Exclusion profile successfully deleted", "success"); }, function (reason) { - thNotify.send(reason.data,"danger"); + thNotify.send(reason.data, "danger"); return $q.reject(reason); } ); diff --git a/ui/js/models/job.js b/ui/js/models/job.js index 74e810865..8c4db42cc 100644 --- a/ui/js/models/job.js +++ b/ui/js/models/job.js @@ -60,7 +60,7 @@ treeherder.factory('ThJobModel', [ // list endpoint. var uri = config.uri || ThJobModel.get_uri(repoName); - return $http.get(uri,{ + return $http.get(uri, { params: options, timeout: timeout }). diff --git a/ui/js/models/job_exclusion.js b/ui/js/models/job_exclusion.js index c58ca6329..5be4398cb 100644 --- a/ui/js/models/job_exclusion.js +++ b/ui/js/models/job_exclusion.js @@ -58,7 +58,7 @@ treeherder.factory('ThJobExclusionModel', [ }); }); } else { - thNotify.send(reason,"danger"); + thNotify.send(reason, "danger"); } return $q.reject(reason); } @@ -85,7 +85,7 @@ treeherder.factory('ThJobExclusionModel', [ }); }); } else { - thNotify.send(reason,"danger"); + thNotify.send(reason, "danger"); } return $q.reject(reason); } @@ -102,7 +102,7 @@ treeherder.factory('ThJobExclusionModel', [ thNotify.send("Job filter successfully deleted", "success"); }, function (reason) { - thNotify.send(reason.data,"danger"); + thNotify.send(reason.data, "danger"); return $q.reject(reason); } ); diff --git a/ui/js/models/job_type.js b/ui/js/models/job_type.js index 7624197fa..9f670a463 100644 --- a/ui/js/models/job_type.js +++ b/ui/js/models/job_type.js @@ -20,7 +20,7 @@ treeherder.factory('ThJobTypeModel', [ ThJobTypeModel.get_list = function (options) { // a static method to retrieve a list of ThJobTypeModel options = options || {}; - return $http.get(ThJobTypeModel.get_uri(),{ + return $http.get(ThJobTypeModel.get_uri(), { cache: true, params: options }). diff --git a/ui/js/models/resultsets_store.js b/ui/js/models/resultsets_store.js index 395a764ea..fea0e8b23 100644 --- a/ui/js/models/resultsets_store.js +++ b/ui/js/models/resultsets_store.js @@ -638,7 +638,7 @@ treeherder.factory('ThResultSetStore', [ unavailableJobs.push.apply(unavailableJobs, ids_unfetched); } return jobsFetched; - },error_callback) + }, error_callback) .then(_.bind(updateJobs, $rootScope, repoName)); } // retry to fetch the unfetched jobs later diff --git a/ui/js/models/user.js b/ui/js/models/user.js index 66aedfcb9..96f79a9ef 100644 --- a/ui/js/models/user.js +++ b/ui/js/models/user.js @@ -22,7 +22,7 @@ treeherder.factory('ThUserModel', [ return (response.data.length > 0) ? new ThUserModel(response.data[0]) : {}; }, function (reason) { - thNotify.send(reason.data,"danger"); + thNotify.send(reason.data, "danger"); return $q.reject(reason); }); }; diff --git a/ui/partials/perf/comparechooserctrl.html b/ui/partials/perf/comparechooserctrl.html index 6b5f24ebf..209981437 100644 --- a/ui/partials/perf/comparechooserctrl.html +++ b/ui/partials/perf/comparechooserctrl.html @@ -19,9 +19,10 @@
- +
diff --git a/ui/plugins/controller.js b/ui/plugins/controller.js index 86e555102..51e01614b 100644 --- a/ui/plugins/controller.js +++ b/ui/plugins/controller.js @@ -468,7 +468,7 @@ treeherder.controller('PluginCtrl', [ "to fill in gaps where the job was not run"; } else { // Cut off trailing "/ " if one exists, capitalize first letter - title = title.replace(/\/ $/,""); + title = title.replace(/\/ $/, ""); title = title.replace(/^./, function (l) { return l.toUpperCase(); }); } diff --git a/ui/plugins/failure_summary/controller.js b/ui/plugins/failure_summary/controller.js index 466f36825..477788255 100644 --- a/ui/plugins/failure_summary/controller.js +++ b/ui/plugins/failure_summary/controller.js @@ -2,7 +2,7 @@ treeherder.controller('BugsPluginCtrl', [ '$scope', '$rootScope', 'ThLog', 'ThTextLogStepModel', - 'ThBugSuggestionsModel', 'thPinboard', 'thEvents','$q', + 'ThBugSuggestionsModel', 'thPinboard', 'thEvents', '$q', 'thTabs', '$timeout', 'thUrl', '$uibModal', '$location', function BugsPluginCtrl( $scope, $rootScope, ThLog, ThTextLogStepModel, ThBugSuggestionsModel, diff --git a/ui/plugins/pinboard.js b/ui/plugins/pinboard.js index 3968d6f3c..f5ad7c4b1 100644 --- a/ui/plugins/pinboard.js +++ b/ui/plugins/pinboard.js @@ -1,7 +1,7 @@ "use strict"; treeherder.controller('PinboardCtrl', [ - '$scope', '$rootScope', '$document', '$timeout','thEvents', 'thPinboard', 'thNotify', 'ThLog', + '$scope', '$rootScope', '$document', '$timeout', 'thEvents', 'thPinboard', 'thNotify', 'ThLog', function PinboardCtrl( $scope, $rootScope, $document, $timeout, thEvents, thPinboard, thNotify, ThLog) { @@ -196,7 +196,7 @@ treeherder.controller('PinboardCtrl', [ title = "Save " + category + " data"; } else { // Cut off trailing "/ " if one exists, capitalize first letter - title = title.replace(/\/ $/,""); + title = title.replace(/\/ $/, ""); title = title.replace(/^./, function (l) { return l.toUpperCase(); }); } diff --git a/ui/plugins/similar_jobs/controller.js b/ui/plugins/similar_jobs/controller.js index 45e88b0ee..31f1608ce 100755 --- a/ui/plugins/similar_jobs/controller.js +++ b/ui/plugins/similar_jobs/controller.js @@ -63,7 +63,7 @@ treeherder.controller('SimilarJobsPluginCtrl', [ thTabs.tabs.similarJobs.is_loading = false; }, function () { - thNotify.send("Error fetching pushes for similar jobs","danger"); + thNotify.send("Error fetching pushes for similar jobs", "danger"); }); } });