I've found cosmetic issue. I'm trying to compile Grafana from the source with zabbix datasource and it's failing because code style errors (whitespaces, multi line breaks). Workaround is easy: first compile and then copy zabbix datasource. It'll be awesome, if workaround is not required.
Thank you.
Output.
# npm install -g grunt-cli && grunt
/usr/bin/grunt -> /usr/lib/node_modules/grunt-cli/bin/grunt
[email protected] /usr/lib/node_modules/grunt-cli
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])
Running "jscs:src" (jscs) task
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
71 | });
72 | }
73 |
------------^
74 | // Called once per panel (graph)
75 | DruidDatasource.prototype.query = function(options) {
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
119 | else if (target.queryType === 'groupBy') {
120 | if (target.hasLimit) {
121 | limitSpec = getLimitSpec(target.limit, target.orderBy);
--------------------------------------------------------------------------^
122 | }
123 | promise = this._groupByQuery(datasource, intervals, granularity, filters, aggregators, postAggregators, groupBy, limitSpec)
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
144 | ...
145 | ]
146 |
--------------^
147 | Druid calculates metrics based on the intervals specified in the query but returns a timestamp rounded down.
148 | We need to adjust the first timestamp in each time series
Expected indentation of 6 characters at public/app/plugins/datasource/druid/datasource.js :
222 | data: query
223 | };
224 | $log.debug("Make http request")
--------------^
225 | $log.debug(options);
226 | return $http(options);
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
318 | ]
319 | /
320 |
--------------^
321 | /
322 | First, we need make sure that the result for each
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
323 | timestamp contains entries for all distinct dimension values
324 | in the entire list of results.
325 |
--------------^
326 | Otherwise, if we do a stacked bar chart, Grafana doesn't sum
327 | the metrics correctly.
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
327 | the metrics correctly.
328 | */
329 |
--------------^
330 | //Get the list of all distinct dimension values for the entire result set
331 | var dVals = md.reduce(function (dValsSoFar, tsItem) {
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
333 | return _.union(dValsSoFar, dValsForTs);
334 | }, {});
335 |
--------------^
336 | //Add null for the metric for any missing dimension values per timestamp result
337 | md.forEach(function (tsItem) {
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
363 | },
364 | ...
365 | ]
-----------------------------^
366 | */
367 | var timestamp = formatTimestamp(item.timestamp);
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
466 | return Math.ceil(intervalSecs/gEntry[1].asSeconds()) <= maxDataPoints;
467 | });
468 |
--------------^
469 | $log.debug("Calculated \"" + granularityEntry[0] + "\" granularity [" + Math.ceil(intervalSecs/granularityEntry[1].asSeconds()) + " pts]" + " for " + (intervalSecs/60).toFixed(0) + " minutes and max of " + maxDataPoints + " data points");
470 | return granularityEntry[0];
Illegal trailing whitespace at public/app/plugins/datasource/druid/datasource.js :
470 | return granularityEntry[0];
471 | }
472 |
------------^
473 | function roundUpStartTime(from, granularity) {
474 | var duration = _.find(GRANULARITIES, function (gEntry) {
Missing space before opening curly brace at public/app/plugins/datasource/kairosdb/kairosdb.Datasource.js :
27 |
28 | var queries = .compact(.map(options.targets, .partial(convertTargetToQuery, options)));
29 | var plotParams = _.compact(.map(options.targets, function(target){
--------------------------------------------------------------------------------^
30 | var alias = target.alias;
31 | if (typeof target.alias == 'undefined' || target.alias == "")
Illegal trailing whitespace at public/app/plugins/datasource/kairosdb/kairosdb.TargetCtrl.js :
67 | if ($scope.target.metric)
68 | $scope.metric.value = $scope.target.metric;
69 | else
---------------------^
70 | $scope.metric.value = "";
71 | $scope.metricListLoading = false;
Expected indentation of 10 characters at public/app/plugins/datasource/prometheus/datasource.js :
140 | })
141 | .value();
142 | });
------------------^
143 | } else {
144 | // if query contains full metric name, return metric name and label list
Expected indentation of 6 characters at public/app/plugins/datasource/prometheus/datasource.js :
157 | });
158 | });
159 | }
--------------^
160 | };
161 |
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
37 | zabbix.init(this.url, this.username, this.password);
38 | }
39 |
--------^
40 |
41 | /**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
142 | });
143 | };
144 |
--------^
145 |
146 | ZabbixAPIDatasource.prototype.handleTrendResponse = function(items, alias, scale, trends) {
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
171 | });
172 | };
173 |
--------^
174 |
175 | /**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
225 | });
226 | };
227 |
--------^
228 |
229 | /**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
303 | }
304 | };
305 |
--------^
306 |
307 | /////////////////
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
308 | // Annotations //
309 | /////////////////
310 |
--------^
311 |
312 | ZabbixAPIDatasource.prototype.annotationQuery = function(annotation, rangeUnparsed) {
Expected indentation of 14 characters at public/app/plugins/datasource/zabbix/datasource.js :
354 | });
355 | return events;
356 | });
----------------------^
357 | } else {
358 | return [];
Expected indentation of 8 characters at public/app/plugins/datasource/zabbix/datasource.js :
358 | return [];
359 | }
360 | });
----------------^
361 | };
362 |
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
364 | });
365 |});
366 |
--------^
367 |
368 |/**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
378 | return metrics.replace(remove_brackets_pattern, '').split(metric_split_pattern)
379 |}
380 |
--------^
381 |
382 |/**
Multiple line break at public/app/plugins/datasource/zabbix/datasource.js :
395 | return date.getFullYear() + '-' + MM + '-' + DD + ' ' + HH + ':' + mm + ':' + ss;
396 |}
397 |
--------^
398 |
399 |/**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
31 | $scope.target.errors = validateTarget($scope.target);
32 | };
33 |
--------^
34 |
35 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
41 | }
42 | };
43 |
--------^
44 |
45 | $scope.targetBlur = function() {
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
51 | }
52 | };
53 |
--------^
54 |
55 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
67 | }
68 | };
69 |
--------^
70 |
71 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
82 | }
83 | };
84 |
--------^
85 |
86 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
96 | }
97 | };
98 |
--------^
99 |
100 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
109 | }
110 | };
111 |
--------^
112 |
113 | $scope.duplicate = function() {
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
115 | $scope.panel.targets.push(clone);
116 | };
117 |
--------^
118 |
119 | $scope.moveMetricQuery = function(fromIndex, toIndex) {
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
124 | // SUGGESTION QUERIES
125 | //////////////////////////////
126 |
--------^
127 |
128 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
137 | });
138 | };
139 |
--------^
140 |
141 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
151 | });
152 | };
153 |
--------^
154 |
155 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
169 | });
170 | };
171 |
--------^
172 |
173 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
191 | });
192 | };
193 |
--------^
194 |
195 | /**
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
206 | });
207 | };
208 |
--------^
209 |
210 | //////////////////////////////
Multiple line break at public/app/plugins/datasource/zabbix/queryCtrl.js :
221 |
222 |});
223 |
--------^
224 |
225 |/**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
18 | this.password = password;
19 | }
20 |
--------^
21 |
22 | //////////////////
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
23 | // Core methods //
24 | //////////////////
25 |
--------^
26 |
27 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
69 | });
70 | };
71 |
--------^
72 |
73 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
100 | };
101 |
102 |
--------^
103 |
104 | /////////////////////////
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
105 | // API method wrappers //
106 | /////////////////////////
107 |
--------^
108 |
109 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
141 | });
142 | };
143 |
--------^
144 |
145 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
178 | });
179 | };
180 |
--------^
181 |
182 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
197 | return this.performZabbixAPIRequest('hostgroup.get', params);
198 | };
199 |
--------^
200 |
201 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
220 | return this.performZabbixAPIRequest('host.get', params);
221 | };
222 |
--------^
223 |
224 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
243 | return this.performZabbixAPIRequest('application.get', params);
244 | };
245 |
--------^
246 |
247 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
287 | return this.performZabbixAPIRequest('item.get', params);
288 | };
289 |
--------^
290 |
291 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
306 | return this.performZabbixAPIRequest('hostgroup.get', params);
307 | };
308 |
--------^
309 |
310 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
324 | return this.performZabbixAPIRequest('hostgroup.get', params);
325 | };
326 |
--------^
327 |
328 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
343 | return this.performZabbixAPIRequest('host.get', params);
344 | };
345 |
--------^
346 |
347 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
362 | return this.performZabbixAPIRequest('application.get', params);
363 | };
364 |
--------^
365 |
366 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
411 | });
412 | };
413 |
--------^
414 |
415 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
449 | });
450 | };
451 |
--------^
452 |
453 | /**
Multiple line break at public/app/plugins/datasource/zabbix/zabbixAPIWrapper.js :
468 | });
469 | };
470 |
--------^
471 |
472 | /**
>> 59 code style errors found!
Warning: Task "jscs:src" failed. Use --force to continue.
Aborted due to warnings.