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

Change subject: Add stylelint for less files
......................................................................


Add stylelint for less files

Fixed the following rules:
- number-leading-zero
- string-quotes
- declaration-property-value-blacklist
- max-empty-lines
- selector-list-comma-newline-after
- selector-pseudo-class-parentheses-space-inside
- color-named

Change-Id: I7ad4be738be5cdf1c27cbc100a8e737fb169e6a2
---
A .stylelintrc
M Gruntfile.js
M modules/ext.CollaborationKit.createhubfeature.styles.less
M modules/ext.CollaborationKit.edit.styles.less
M modules/ext.CollaborationKit.hub.styles.less
M modules/ext.CollaborationKit.hub.subpage.styles.less
M modules/ext.CollaborationKit.hubtheme.styles.less
M modules/ext.CollaborationKit.iconbrowser.styles.less
M modules/ext.CollaborationKit.list.styles.less
M modules/ext.CollaborationKit.mixins.less
M package.json
11 files changed, 63 insertions(+), 46 deletions(-)

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



diff --git a/.stylelintrc b/.stylelintrc
new file mode 100644
index 0000000..1f41ed8
--- /dev/null
+++ b/.stylelintrc
@@ -0,0 +1,9 @@
+{
+       "extends": "stylelint-config-wikimedia",
+       "rules": {
+               "declaration-block-no-shorthand-property-overrides": null,
+               "no-duplicate-selectors": null,
+               "no-descending-specificity": null,
+               "declaration-no-important": null
+       }
+}
diff --git a/Gruntfile.js b/Gruntfile.js
index f1ff682..414bec0 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -4,6 +4,7 @@
        grunt.loadNpmTasks( 'grunt-jsonlint' );
        grunt.loadNpmTasks( 'grunt-banana-checker' );
        grunt.loadNpmTasks( 'grunt-jscs' );
+       grunt.loadNpmTasks( 'grunt-stylelint' );
 
        grunt.initConfig( {
                jshint: {
@@ -26,12 +27,19 @@
                        all: [
                                '*.json',
                                '**/*.json',
+                               '.stylelintrc',
                                '!node_modules/**',
                                '!vendor/**'
+                       ]
+               },
+               stylelint: {
+                       all: [
+                               '**/*.less',
+                               '!node_modules/**'
                        ]
                }
        } );
 
-       grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] 
);
+       grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana', 
'stylelint' ] );
        grunt.registerTask( 'default', 'test' );
 };
diff --git a/modules/ext.CollaborationKit.createhubfeature.styles.less 
b/modules/ext.CollaborationKit.createhubfeature.styles.less
index f6fff69..b783503 100644
--- a/modules/ext.CollaborationKit.createhubfeature.styles.less
+++ b/modules/ext.CollaborationKit.createhubfeature.styles.less
@@ -21,5 +21,5 @@
 }
 
 .oo-ui-fieldLayout.oo-ui-labelElement.mw-ck-icon-input 
.oo-ui-buttonElement.mw-ck-iconbrowser-enabled.oo-ui-buttonElement-framed {
-       margin-top: .5em;
+       margin-top: 0.5em;
 }
diff --git a/modules/ext.CollaborationKit.edit.styles.less 
b/modules/ext.CollaborationKit.edit.styles.less
index e9781f3..e20f551 100644
--- a/modules/ext.CollaborationKit.edit.styles.less
+++ b/modules/ext.CollaborationKit.edit.styles.less
@@ -1,4 +1,4 @@
-@import "ext.CollaborationKit.mixins.less";
+@import 'ext.CollaborationKit.mixins.less';
 
 .ck-customeditor-borders( @default );
 
diff --git a/modules/ext.CollaborationKit.hub.styles.less 
b/modules/ext.CollaborationKit.hub.styles.less
index 9ac5995..8d550ea 100644
--- a/modules/ext.CollaborationKit.hub.styles.less
+++ b/modules/ext.CollaborationKit.hub.styles.less
@@ -1,4 +1,4 @@
-@import "ext.CollaborationKit.mixins.less";
+@import 'ext.CollaborationKit.mixins.less';
 
 .mw-ck-hub-toc {
        clear: both;
@@ -13,7 +13,7 @@
                text-align: center;
                list-style: none;
                float: left;
-               margin: .5em 1.25em .5em 0;
+               margin: 0.5em 1.25em 0.5em 0;
                word-wrap: break-word;
        }
        div,
@@ -55,7 +55,7 @@
        .mw-ck-hub-section {
                border: solid 5px;
                border-style: solid none none;
-               padding: 1em 0 .5em;
+               padding: 1em 0 0.5em;
                margin: 2.5em 0 1em;
                clear: left;
 
@@ -63,11 +63,11 @@
                        display: inline;
                        margin: 0;
                        padding: 0;
-                       border-style: none;
+                       border-style: 0;
                }
 
                .mw-ck-hub-section-main {
-                       padding-top: .25em;
+                       padding-top: 0.25em;
                }
        }
        .mw-ck-hub-section-buttons {
@@ -75,7 +75,7 @@
                margin-left: 2em;
        }
        .mw-ck-hub-section-button {
-               margin: -.2em 1em 0 0;
+               margin: -0.2em 1em 0 0;
        }
 }
 .mw-ck-collaborationhub ul {
@@ -106,7 +106,7 @@
        width: 25%;
 
        h3 {
-               margin: 0 0 .5em;
+               margin: 0 0 0.5em;
                padding: 0;
                text-align: center;
        }
@@ -137,7 +137,6 @@
        margin-right: 8em;
        text-align: center;
 }
-
 
 // Themes
 .mw-body .mw-ck-collaborationhub {
diff --git a/modules/ext.CollaborationKit.hub.subpage.styles.less 
b/modules/ext.CollaborationKit.hub.subpage.styles.less
index 4be3a3f..3b1f53c 100644
--- a/modules/ext.CollaborationKit.hub.subpage.styles.less
+++ b/modules/ext.CollaborationKit.hub.subpage.styles.less
@@ -1,14 +1,15 @@
 // I dunno what to name things.
 
-@import "ext.CollaborationKit.mixins.less";
+@import 'ext.CollaborationKit.mixins.less';
 
 .mw-ck-subpage-toc {
        border-width: 3px;
        border-style: solid none;
-       padding: .125em 0 .5em;
+       padding: 0.125em 0 0.5em;
        margin: 2em 0;
 
-       a, a:visited {
+       a,
+       a:visited {
                color: #446;
 
                &.new {
@@ -31,9 +32,9 @@
                margin: 0;
                font-size: 90%;
 
-               li:not(:last-child):after {
+               li:not( :last-child ):after {
                        content: '|';
-                       margin: 0 .5em;
+                       margin: 0 0.5em;
                }
        }
        li div,
@@ -45,7 +46,7 @@
        margin-top: -1em;
 
        span {
-               padding: .15em .5em .15em 0;
+               padding: 0.15em 0.5em 0.15em 0;
                background: #fff; // TODO make this actually follow skin 
background
                font-weight: bold;
        }
@@ -64,7 +65,7 @@
 
        &:after{
                content: 'ยป';
-               margin: 0 .5em;
+               margin: 0 0.5em;
        }
 }
 .mw-ck-subpage-toc .mw-ck-file-image,
@@ -72,9 +73,8 @@
        width: 16px;
        height: 16px;
        overflow: hidden;
-       margin: 0 .25em -3px 0;
+       margin: 0 0.25em -3px 0;
 }
-
 
 // Unnecessary as the ToC will link back anyway
 div span.subpages {
@@ -89,7 +89,6 @@
 .mw-ck-file-image p {
        margin: 0 !important;
 }
-
 
 // Themes
 .mw-ck-theme-darkred {
diff --git a/modules/ext.CollaborationKit.hubtheme.styles.less 
b/modules/ext.CollaborationKit.hubtheme.styles.less
index 0eb8905..853d6af 100644
--- a/modules/ext.CollaborationKit.hubtheme.styles.less
+++ b/modules/ext.CollaborationKit.hubtheme.styles.less
@@ -1,4 +1,4 @@
-@import "ext.CollaborationKit.mixins.less";
+@import 'ext.CollaborationKit.mixins.less';
 
 .mw-ck-hub-topform {
        display: flex;
@@ -31,8 +31,8 @@
        background: #fff;
        opacity: 0.75;
        border: solid 1px #a2a9b1;
-       border-right: none;
-       border-bottom: none;
+       border-right: 0;
+       border-bottom: 0;
        border-radius: 0 2px 2px 0;
 
        a span {
@@ -43,8 +43,8 @@
        &:hover,
        &:active {
                border: solid 1px #72777d;
-               border-right: none;
-               border-bottom: none;
+               border-right: 0;
+               border-bottom: 0;
                opacity: 0.9;
        }
 }
@@ -85,17 +85,17 @@
 }
 
 .mw-ck-colourblock-container {
-       margin-top: .75em;
-       margin-bottom: .5em;
+       margin-top: 0.75em;
+       margin-bottom: 0.5em;
 }
 
 .oo-ui-optionWidget-selected .mw-ck-colourblock {
        border: 2px solid #2a4b8d;
        width: 146px;
        height: 26px;
-       -webkit-box-shadow: 0 0 5px 0 rgba(42,75,141,1);
-       -moz-box-shadow: 0 0 5px 0 rgba(42,75,141,1);
-       box-shadow: 0 0 5px 0 rgba(42,75,141,1);
+       -webkit-box-shadow: 0 0 5px 0 rgba( 42, 75, 141, 1 );
+       -moz-box-shadow: 0 0 5px 0 rgba( 42, 75, 141, 1 );
+       box-shadow: 0 0 5px 0 rgba( 42, 75, 141, 1 );
 }
 
 .colourBrowserButton {
diff --git a/modules/ext.CollaborationKit.iconbrowser.styles.less 
b/modules/ext.CollaborationKit.iconbrowser.styles.less
index 3a94212..fd64250 100644
--- a/modules/ext.CollaborationKit.iconbrowser.styles.less
+++ b/modules/ext.CollaborationKit.iconbrowser.styles.less
@@ -1,10 +1,11 @@
-@import "ext.CollaborationKit.mixins.less";
+@import 'ext.CollaborationKit.mixins.less';
 
 label.oo-ui-optionWidget-selected .mw-ck-iconbrowser-iconcontainer {
        background: #c4e2ff;
 }
 
-.mw-ck-iconbrowser-icon, .iconPreview {
+.mw-ck-iconbrowser-icon,
+.iconPreview {
        width: 5em;
        height: 5em;
        background-position: 50% 50%;
@@ -13,7 +14,7 @@
 
 .mw-ck-iconbrowser-iconcontainer {
        margin-right: 1.5em;
-       padding: .25em;
+       padding: 0.25em;
        border-radius: 2em;
 }
 
diff --git a/modules/ext.CollaborationKit.list.styles.less 
b/modules/ext.CollaborationKit.list.styles.less
index 7f3265c..bf1da1f 100644
--- a/modules/ext.CollaborationKit.list.styles.less
+++ b/modules/ext.CollaborationKit.list.styles.less
@@ -1,4 +1,4 @@
-@import "ext.CollaborationKit.mixins.less";
+@import 'ext.CollaborationKit.mixins.less';
 
 /* Styles needed when transcluding list content */
 
@@ -38,13 +38,13 @@
 .mw-ck-multilist {
        .flex-display;
        .flex-wrap;
-       margin: 0 -.5em;
+       margin: 0 -0.5em;
 
        .mw-ck-list-column {
                .grey-box();
                float: left; // IE9 workaround, maybe
                .flex();
-               margin: .5em;
+               margin: 0.5em;
                min-width: 20em; // Todo something smarter for mobile/genuinely 
narrow things?
                max-width: 35em;
                -webkit-flex-basis: 25em;
@@ -58,7 +58,7 @@
                margin: 0;
        }
        .mw-ck-list-column-header {
-               padding: 1.25em 1.5em .35em;
+               padding: 1.25em 1.5em 0.35em;
 
                // YOU ARE AN IDIOT AND YOU SUCK, SELF
                // Can anyone else explain how this voodoo works? because now I 
can't figure it out
@@ -161,7 +161,6 @@
 /* Stuff below here could potentially be in a separate module since
  * its only used on direct page and not when transcluding */
 
-
 /* Separate so spinner can replace properly */
 .mw-ck-list-deletebutton {
        margin-left: 2em;
@@ -201,11 +200,11 @@
 }
 
 .mw-ck-list-dragplaceholder {
-       border: black thin dashed;
+       border: #000 thin dashed;
        width: 25%;
 }
 
 .mw-ck-list-title .jquery-confirmable-text,
 .mw-ck-list-title .mw-spinner {
-       padding-left: .5em;
+       padding-left: 0.5em;
 }
diff --git a/modules/ext.CollaborationKit.mixins.less 
b/modules/ext.CollaborationKit.mixins.less
index 37e2bc9..d0fd73c 100644
--- a/modules/ext.CollaborationKit.mixins.less
+++ b/modules/ext.CollaborationKit.mixins.less
@@ -1,4 +1,4 @@
-@import "mediawiki.mixins";
+@import 'mediawiki.mixins';
 
 .mw-ck-icon {
        content: '';
@@ -44,16 +44,16 @@
        padding: 1.5em;
 
        h2 {
-               margin: 0 0 .5em;
+               margin: 0 0 0.5em;
                padding: 0;
-               border: none;
+               border: 0;
                font-size: 1.5em;
        }
 
        .oo-ui-buttonWidget {
                display: block;
                margin-right: 0;
-               margin-top: .5em;
+               margin-top: 0.5em;
        }
        .oo-ui-buttonElement-framed > .oo-ui-buttonElement-button {
                display: block;
diff --git a/package.json b/package.json
index 13889a8..7c8136d 100644
--- a/package.json
+++ b/package.json
@@ -10,6 +10,8 @@
     "grunt-contrib-jshint": "0.11.3",
     "grunt-banana-checker": "0.4.0",
     "grunt-jscs": "2.5.0",
-    "grunt-jsonlint": "1.0.7"
+    "grunt-jsonlint": "1.0.7",
+    "grunt-stylelint": "0.7.0",
+    "stylelint-config-wikimedia": "0.4.1"
   }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7ad4be738be5cdf1c27cbc100a8e737fb169e6a2
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/CollaborationKit
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to