<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][9697] trunk: Build: add SCSS linter (`grunt-scss-lint`) to Grunt build process.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/9697">9697</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/9697","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>djpaul</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-04-05 14:21:26 +0000 (Sun, 05 Apr 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Build: add SCSS linter (`grunt-scss-lint`) to Grunt build process.
As part of the companion stylesheet changes for BP 2.3 (<a href="http://buddypress.trac.wordpress.org/ticket/6291">#6291</a> <a href="http://buddypress.trac.wordpress.org/ticket/6338">#6338</a>), we'll be adding SCSS files to `src/bp-templates/bp-legacy/css/` to help modernise our CSS workflow. This change adds a SCSS linter to help us maintain our code quality.
An empty `src/bp-templates/bp-legacy/css/twentyfifteen.scss` file has been added because the linter hangs if you tell it to run in a folder that does not contain any SCSS files. This will be replaced shortly with the real companion stylesheet for `twentyfifteen` (<a href="http://buddypress.trac.wordpress.org/ticket/6291">#6291</a>).
As `grunt-scss-lint` relies on a ruby gem, the Travis-CI config has been modified to install it before running tests.
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/6351">#6351</a>, props netweb.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunktravisyml">trunk/.travis.yml</a></li>
<li><a href="#trunkGruntfilejs">trunk/Gruntfile.js</a></li>
<li><a href="#trunkpackagejson">trunk/package.json</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkscsslintyml">trunk/.scss-lint.yml</a></li>
<li><a href="#trunksrcbptemplatesbplegacycsstwentyfifteenscss">trunk/src/bp-templates/bp-legacy/css/twentyfifteen.scss</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkscsslintyml"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/.scss-lint.yml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/.scss-lint.yml (rev 0)
+++ trunk/.scss-lint.yml 2015-04-05 14:21:26 UTC (rev 9697)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,189 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+# Default application configuration that all configurations inherit from.
+
+scss_files: "**/*.scss"
+
+linters:
+ BangFormat:
+ enabled: true
+ space_before_bang: true
+ space_after_bang: false
+
+ BorderZero:
+ enabled: true
+ convention: zero # or `none`
+
+ ColorKeyword:
+ enabled: true
+
+ ColorVariable:
+ enabled: false
+
+ Comment:
+ enabled: false
+
+ DebugStatement:
+ enabled: true
+
+ DeclarationOrder:
+ enabled: true
+
+ DuplicateProperty:
+ enabled: false
+
+ ElsePlacement:
+ enabled: true
+ style: same_line # or 'new_line'
+
+ EmptyLineBetweenBlocks:
+ enabled: true
+ ignore_single_line_blocks: true
+
+ EmptyRule:
+ enabled: true
+
+ FinalNewline:
+ enabled: true
+ present: true
+
+ HexLength:
+ enabled: true
+ style: short # or 'long'
+
+ HexNotation:
+ enabled: true
+ style: lowercase # or 'uppercase'
+
+ HexValidation:
+ enabled: true
+
+ IdSelector:
+ enabled: false
+
+ ImportantRule:
+ enabled: false
+
+ ImportPath:
+ enabled: true
+ leading_underscore: false
+ filename_extension: false
+
+ Indentation:
+ enabled: true
+ allow_non_nested_indentation: false
+ character: tab # or 'space'
+ width: 1
+
+ LeadingZero:
+ enabled: true
+ style: include_zero # or 'include_zero'
+
+ MergeableSelector:
+ enabled: false
+ force_nesting: true
+
+ NameFormat:
+ enabled: true
+ allow_leading_underscore: true
+ convention: hyphenated_lowercase # or 'BEM', or a regex pattern
+
+ NestingDepth:
+ enabled: true
+ max_depth: 5
+
+ PlaceholderInExtend:
+ enabled: true
+
+ PropertyCount:
+ enabled: false
+ include_nested: false
+ max_properties: 10
+
+ PropertySortOrder:
+ enabled: true
+ ignore_unspecified: false
+ separate_groups: false
+
+ PropertySpelling:
+ enabled: true
+ extra_properties: []
+
+ QualifyingElement:
+ enabled: false
+ allow_element_with_attribute: false
+ allow_element_with_class: false
+ allow_element_with_id: false
+
+ SelectorDepth:
+ enabled: true
+ max_depth: 6
+
+ SelectorFormat:
+ enabled: true
+ convention: hyphenated_lowercase # or 'BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern
+
+ Shorthand:
+ enabled: true
+
+ SingleLinePerProperty:
+ enabled: true
+ allow_single_line_rule_sets: true
+
+ SingleLinePerSelector:
+ enabled: true
+
+ SpaceAfterComma:
+ enabled: true
+
+ SpaceAfterPropertyColon:
+ enabled: true
+ style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'
+
+ SpaceAfterPropertyName:
+ enabled: true
+
+ SpaceBeforeBrace:
+ enabled: true
+ style: space # or 'new_line'
+ allow_single_line_padding: false
+
+ SpaceBetweenParens:
+ enabled: true
+ spaces: 0
+
+ StringQuotes:
+ enabled: true
+ style: double_quotes
+
+ TrailingSemicolon:
+ enabled: true
+
+ TrailingZero:
+ enabled: false
+
+ UnnecessaryMantissa:
+ enabled: true
+
+ UnnecessaryParentReference:
+ enabled: true
+
+ UrlFormat:
+ enabled: true
+
+ UrlQuotes:
+ enabled: true
+
+ VariableForProperty:
+ enabled: false
+ properties: []
+
+ VendorPrefix:
+ enabled: true
+ identifier_list: base
+ additional_identifiers: []
+ excluded_identifiers: []
+
+ ZeroUnit:
+ enabled: true
+
+ Compass::*:
+ enabled: false
</ins></span></pre></div>
<a id="trunktravisyml"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/.travis.yml</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/.travis.yml 2015-04-05 04:30:16 UTC (rev 9696)
+++ trunk/.travis.yml 2015-04-05 14:21:26 UTC (rev 9697)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,6 +55,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> # prepare for running the tests
</span><span class="cx" style="display: block; padding: 0 10px"> - cd $plugin_dir
</span><span class="cx" style="display: block; padding: 0 10px"> - npm install -g grunt-cli
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ - gem install scss-lint
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> # before_script: Failures in this section will result in build status 'errored'
</span><span class="cx" style="display: block; padding: 0 10px"> before_script:
</span></span></pre></div>
<a id="trunkGruntfilejs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/Gruntfile.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/Gruntfile.js 2015-04-05 04:30:16 UTC (rev 9696)
+++ trunk/Gruntfile.js 2015-04-05 14:21:26 UTC (rev 9697)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -163,6 +163,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'https://wordpress.org/plugins/buddypress/ */\n'
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ scsslint: {
+ options: {
+ bundleExec: false,
+ colorizeOutput: true,
+ config: '.scss-lint.yml'
+ },
+ core: [ SOURCE_DIR + 'bp-templates/bp-legacy/css/*.scss' ]
+ },
</ins><span class="cx" style="display: block; padding: 0 10px"> cssmin: {
</span><span class="cx" style="display: block; padding: 0 10px"> minify: {
</span><span class="cx" style="display: block; padding: 0 10px"> cwd: BUILD_DIR,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -228,7 +236,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Register tasks.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- grunt.registerTask( 'src', ['jsvalidate:src', 'jshint', 'cssjanus'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ grunt.registerTask( 'src', ['jsvalidate:src', 'jshint', 'scsslint', 'cssjanus'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> grunt.registerTask( 'commit', ['src', 'checktextdomain', 'imagemin'] );
</span><span class="cx" style="display: block; padding: 0 10px"> grunt.registerTask( 'build', ['commit', 'clean:all', 'copy:files', 'uglify', 'jsvalidate:build', 'cssmin', 'makepot', 'exec:bpdefault'] );
</span><span class="cx" style="display: block; padding: 0 10px"> grunt.registerTask( 'release', ['build', 'exec:bbpress'] );
</span></span></pre></div>
<a id="trunkpackagejson"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/package.json</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/package.json 2015-04-05 04:30:16 UTC (rev 9696)
+++ trunk/package.json 2015-04-05 14:21:26 UTC (rev 9697)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,6 +20,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> "grunt-legacy-util": "^0.2.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "grunt-patch-wordpress": "~0.3.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "grunt-sass": "~0.18.0",
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ "grunt-scss-lint": "~0.3.6",
</ins><span class="cx" style="display: block; padding: 0 10px"> "grunt-wp-i18n": "~0.5.0",
</span><span class="cx" style="display: block; padding: 0 10px"> "matchdep": "~0.3.0"
</span><span class="cx" style="display: block; padding: 0 10px"> },
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacycsstwentyfifteenscss"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: trunk/src/bp-templates/bp-legacy/css/twentyfifteen.scss</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">
</span></span></pre>
</div>
</div>
</body>
</html>