jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/369341 )

Change subject: build: bump grunt-jscs to 2.1.0
......................................................................


build: bump grunt-jscs to 2.1.0

Avoids a peer dependency incompatibility with grunt
Update file comments /** -> /*! per T119193
Add new lines in comments

Ignore a jscs-jsdoc issue with return values since it does not detect
class inheritance:
https://github.com/jscs-dev/jscs-jsdoc/issues/31

Change-Id: If81ad41eaf4b3ea9405f15b8a2d20c4b83ba5a56
---
M package.json
M resources/head.js
M resources/loader.js
M resources/logger/LoadingTimeLogger.js
M resources/logger/Logger.js
5 files changed, 23 insertions(+), 7 deletions(-)

Approvals:
  Umherirrender: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/package.json b/package.json
index 5e4e1fc..ac39615 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
     "grunt": "1.0.1",
     "grunt-banana-checker": "0.4.0",
     "grunt-contrib-jshint": "0.11.3",
-    "grunt-jscs": "1.8.0",
+    "grunt-jscs": "2.1.0",
     "grunt-jsonlint": "1.0.7"
   }
 }
diff --git a/resources/head.js b/resources/head.js
index c92df69..44b935a 100644
--- a/resources/head.js
+++ b/resources/head.js
@@ -1,6 +1,7 @@
-/**
+/*!
  * JavaScript module for image-related metrics.
  * Top-loaded on every request to measure timing of events which might happen 
before normal script load.
+ *
  * @see https://mediawiki.org/wiki/Extension:ImageMetrics
  *
  * @licence GNU GPL v2 or later
diff --git a/resources/loader.js b/resources/loader.js
index f14adca..905f404 100644
--- a/resources/loader.js
+++ b/resources/loader.js
@@ -1,4 +1,4 @@
-/**
+/*!
  * JavaScript module for image-related metrics.
  * This module will be loaded on every request to perform sampling and load 
the real module if needed.
  * @see https://mediawiki.org/wiki/Extension:ImageMetrics
@@ -17,6 +17,7 @@
        /**
         * Makes a random decision (based on samplingRatio) whether an event 
should be logged.
         * Returns true with 1/samplingRatio probability, or false if 
samplingRatio  is not a number or smaller than 1.
+        *
         * @param {number|boolean} samplingRatio
         * @return {boolean}
         */
diff --git a/resources/logger/LoadingTimeLogger.js 
b/resources/logger/LoadingTimeLogger.js
index 8a2cd4e..6d686e2 100644
--- a/resources/logger/LoadingTimeLogger.js
+++ b/resources/logger/LoadingTimeLogger.js
@@ -1,4 +1,4 @@
-/**
+/*!
  * JavaScript module for image-related metrics.
  * @see https://mediawiki.org/wiki/Extension:ImageMetrics
  *
@@ -45,17 +45,22 @@
 
        /**
         * Factory function to take care of dependency injection.
+        *
         * @static
         * @param {number} samplingFactor sampling factor
         * @return {mw.imageMetrics.LoadingTimeLogger}
         */
        LoadingTimeLogger.create = function ( samplingFactor ) {
+               // https://github.com/jscs-dev/jscs-jsdoc/issues/31
+               // jscs:disable
                return new LoadingTimeLogger( samplingFactor, window.location, 
mw.config, window.Geo,
                        mw.eventLog, window.performance );
+               // jscs:enable
        };
 
        /**
         * Installs the event handler which will perform the logging.
+        *
         * @static
         * @param {number} samplingFactor sampling factor
         */
@@ -100,17 +105,19 @@
 
        /**
         * Adds navigation type (reload, back etc) to the log data from the 
NavigationTiming API.
+        *
         * @param {Object} data
         */
        LoadingTimeLogger.prototype.addNavigationTimingData = function ( data ) 
{
                if ( this.performance.navigation && 
this.performance.navigation.type in this.navigationTypes ) {
-                       data.navigationType = 
this.navigationTypes[this.performance.navigation.type];
+                       data.navigationType = this.navigationTypes[ 
this.performance.navigation.type ];
                }
        };
 
        /**
         * Returns timing data about the given file.
         * Requires ResourceTiming support - http://caniuse.com/resource-timing
+        *
         * @param {jQuery} $file jQuery object containing the img element
         * @return {PerformanceResourceTiming|boolean} timing object or false 
if not supported
         */
@@ -122,7 +129,7 @@
                }
 
                url = $file.prop( 'src' ); // attr() might be relative, prop() 
is always absolute
-               timing = this.performance.getEntriesByName( url )[0];
+               timing = this.performance.getEntriesByName( url )[ 0 ];
                if ( !timing ) {
                        return false;
                }
@@ -136,6 +143,7 @@
         * - ownLoadingTime: net time it took the browser to load the image 
(PerformanceResourceTiming.duration)
         * - fullLoadingTime: total time from opening the page to finishing the 
image load  (PerformanceResourceTiming.responseEnd)
         * - fetchDelay: time between requesting the image and receiving the 
first byte (might be missing)
+        *
         * @param {Object} data
         * @param {jQuery} $file jQuery object containing the img element
         */
@@ -151,6 +159,7 @@
 
        /**
         * Adds non-ResourceTiming/NavigationTimning-based information.
+        *
         * @param {Object} data
         * @param {jQuery} $file jQuery object containing the img element
         */
diff --git a/resources/logger/Logger.js b/resources/logger/Logger.js
index 497857b..36c3152 100644
--- a/resources/logger/Logger.js
+++ b/resources/logger/Logger.js
@@ -1,4 +1,4 @@
-/**
+/*!
  * JavaScript module for image-related metrics.
  * @see https://mediawiki.org/wiki/Extension:Logger
  *
@@ -10,6 +10,7 @@
 
        /**
         * Abstract parent class for metrics tasks.
+        *
         * @class mw.imageMetrics.Logger
         * @constructor
         * @param {number} samplingFactor sampling factor
@@ -42,12 +43,16 @@
 
        /**
         * Factory function to take care of dependency injection.
+        *
         * @static
         * @param {number} samplingFactor sampling factor
         * @return {mw.imageMetrics.Logger}
         */
        Logger.create = function ( samplingFactor ) {
+               // https://github.com/jscs-dev/jscs-jsdoc/issues/31
+               // jscs:disable
                return new Logger( samplingFactor, window.location, mw.config, 
window.Geo, mw.eventLog );
+               // jscs:enable
        };
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/369341
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If81ad41eaf4b3ea9405f15b8a2d20c4b83ba5a56
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ImageMetrics
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: Gergő Tisza <gti...@wikimedia.org>
Gerrit-Reviewer: Legoktm <lego...@member.fsf.org>
Gerrit-Reviewer: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to