UNPKG

stylint

Version:
1,139 lines (1,102 loc) 43.5 kB
<!doctype html> <html lang="en"> <head> <title>Code coverage report for stylus-lint/src/test.js</title> <meta charset="utf-8"> <link rel="stylesheet" href="../../prettify.css"> <style> body, html { margin:0; padding: 0; } body { font-family: Helvetica Neue, Helvetica,Arial; font-size: 10pt; } div.header, div.footer { background: #eee; padding: 1em; } div.header { z-index: 100; position: fixed; top: 0; border-bottom: 1px solid #666; width: 100%; } div.footer { border-top: 1px solid #666; } div.body { margin-top: 10em; } div.meta { font-size: 90%; text-align: center; } h1, h2, h3 { font-weight: normal; } h1 { font-size: 12pt; } h2 { font-size: 10pt; } pre { font-family: Consolas, Menlo, Monaco, monospace; margin: 0; padding: 0; line-height: 14px; font-size: 14px; -moz-tab-size: 2; -o-tab-size: 2; tab-size: 2; } div.path { font-size: 110%; } div.path a:link, div.path a:visited { color: #000; } table.coverage { border-collapse: collapse; margin:0; padding: 0 } table.coverage td { margin: 0; padding: 0; color: #111; vertical-align: top; } table.coverage td.line-count { width: 50px; text-align: right; padding-right: 5px; } table.coverage td.line-coverage { color: #777 !important; text-align: right; border-left: 1px solid #666; border-right: 1px solid #666; } table.coverage td.text { } table.coverage td span.cline-any { display: inline-block; padding: 0 5px; width: 40px; } table.coverage td span.cline-neutral { background: #eee; } table.coverage td span.cline-yes { background: #b5d592; color: #999; } table.coverage td span.cline-no { background: #fc8c84; } .cstat-yes { color: #111; } .cstat-no { background: #fc8c84; color: #111; } .fstat-no { background: #ffc520; color: #111 !important; } .cbranch-no { background: yellow !important; color: #111; } .cstat-skip { background: #ddd; color: #111; } .fstat-skip { background: #ddd; color: #111 !important; } .cbranch-skip { background: #ddd !important; color: #111; } .missing-if-branch { display: inline-block; margin-right: 10px; position: relative; padding: 0 4px; background: black; color: yellow; } .skip-if-branch { display: none; margin-right: 10px; position: relative; padding: 0 4px; background: #ccc; color: white; } .missing-if-branch .typ, .skip-if-branch .typ { color: inherit !important; } .entity, .metric { font-weight: bold; } .metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; } .metric small { font-size: 80%; font-weight: normal; color: #666; } div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; } div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; } div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; } div.coverage-summary th.file { border-right: none !important; } div.coverage-summary th.pic { border-left: none !important; text-align: right; } div.coverage-summary th.pct { border-right: none !important; } div.coverage-summary th.abs { border-left: none !important; text-align: right; } div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; } div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; } div.coverage-summary td.file { text-align: right; border-left: 1px solid #666; white-space: nowrap; } div.coverage-summary td.pic { min-width: 120px !important; } div.coverage-summary a:link { text-decoration: none; color: #000; } div.coverage-summary a:visited { text-decoration: none; color: #333; } div.coverage-summary a:hover { text-decoration: underline; } div.coverage-summary tfoot td { border-top: 1px solid #666; } div.coverage-summary .yui3-datatable-sort-indicator, div.coverage-summary .dummy-sort-indicator { height: 10px; width: 7px; display: inline-block; margin-left: 0.5em; } div.coverage-summary .yui3-datatable-sort-indicator { background: url("https://yui-s.yahooapis.com/3.6.0/build/datatable-sort/assets/skins/sam/sort-arrow-sprite.png") no-repeat scroll 0 0 transparent; } div.coverage-summary .yui3-datatable-sorted .yui3-datatable-sort-indicator { background-position: 0 -20px; } div.coverage-summary .yui3-datatable-sorted-desc .yui3-datatable-sort-indicator { background-position: 0 -10px; } .high { background: #b5d592 !important; } .medium { background: #ffe87c !important; } .low { background: #fc8c84 !important; } span.cover-fill, span.cover-empty { display:inline-block; border:1px solid #444; background: white; height: 12px; } span.cover-fill { background: #ccc; border-right: 1px solid #444; } span.cover-empty { background: white; border-left: none; } span.cover-full { border-right: none !important; } pre.prettyprint { border: none !important; padding: 0 !important; margin: 0 !important; } .com { color: #999 !important; } .ignore-none { color: #999; font-weight: normal; } </style> </head> <body> <div class="header medium"> <h1>Code coverage report for <span class="entity">stylus-lint/src/test.js</span></h1> <h2> Statements: <span class="metric">74.34% <small>(84 / 113)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Branches: <span class="metric">61.86% <small>(120 / 194)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Functions: <span class="metric">100% <small>(1 / 1)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Lines: <span class="metric">74.34% <small>(84 / 113)</small></span> &nbsp;&nbsp;&nbsp;&nbsp; Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp; </h2> <div class="path"><a href="../../index.html">All files</a> &#187; <a href="index.html">stylus-lint/src/</a> &#187; test.js</div> </div> <div class="body"> <pre><table class="coverage"> <tr><td class="line-count">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">12787</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">12787</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1898</span> <span class="cline-any cline-yes">16</span> <span class="cline-any cline-yes">16</span> <span class="cline-any cline-yes">16</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1882</span> <span class="cline-any cline-yes">16</span> <span class="cline-any cline-yes">16</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">12771</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">12767</span> <span class="cline-any cline-yes">16</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">16</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">12763</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">12561</span> <span class="cline-any cline-yes">1858</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">12561</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11083</span> <span class="cline-any cline-yes">380</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11083</span> <span class="cline-any cline-yes">18</span> <span class="cline-any cline-yes">18</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11065</span> <span class="cline-any cline-yes">18</span> <span class="cline-any cline-yes">18</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">56</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">8</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">49</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">8</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">8</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">4</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">1</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">34</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">2</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">20</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">11047</span> <span class="cline-any cline-yes">28</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict'; &nbsp; var chalk = require('chalk'), valid = require('./data/getValid')(); &nbsp; /** * @description runs tests * @param {string} line [the curr line being tested, in its original form] * @param {number} num [line number being tested] * @param {string} output [trimmed line to output] * @param {string} file [name of file being tested] * @return void */ module.exports = function test( app, line, num, output, file ) { // just some convenience stuff var arr = line.split(' '); &nbsp; // check for @stylint off comments if ( app.hasComment( line ) ) { /** * these first two tests determine if the rest of the tests should run * if @stylint: off comment found, disable tests until @stylint: on comment found */ if ( line.indexOf('@stylint off') !== -1 ) { app.state.toggleBlock = true; app.state.testsEnabled = false; return; } &nbsp; if ( app.state.toggleBlock &amp;&amp; line.indexOf('@stylint on') !== -1 ) { app.state.toggleBlock = false; app.state.testsEnabled = true; } } &nbsp; // by default we skip css literals, but if css literal option set to true we throw a warning if ( app.config.cssLiteral === false &amp;&amp; line.indexOf('@css') !== -1 ) { app.state.cssBlock = true; return; } &nbsp; // if we're in a css block, check for the end of it if ( app.state.cssBlock ) { app.state.testsEnabled = false; &nbsp; // hash ending checks for } as the first character if ( app.hashEnding(line, true) ) { app.state.cssBlock = false; app.state.testsEnabled = true; return; } } &nbsp; // are we running any tests at all? if ( app.state.testsEnabled ) { // check for comment style (//dont do this. // do this) if ( app.hasComment(line) ) { <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.commentSpace || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.commentStyleCorrect(line) === false ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('line comments require a space after //') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } } &nbsp; // does the line start with a comment? dont run the following tests if ( !app.startsWithComment(line) ) { &nbsp; // does the line have a comment after the stylus? trim it before we run tests if ( app.hasComment(line) ) { line = line.slice( 0, line.indexOf('//') - 1 ); } &nbsp; // the only valid use of brackets is in a hash if ( app.hashStarting(line) ) { app.state.hash = true; return; } &nbsp; // if the above equals true we check for the end of the hash if ( app.hashEnding( line, app.state.hash ) ) { app.state.hash = false; return; } &nbsp; // check for 0px (margin 0 is preferred over margin 0px | 0em | 0whatever) <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.alphabetical || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( !app.alphabetCheck( line, valid ) ) { app.warnings.push( chalk.yellow( 'Property is not in alphabetical order' ) + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check that commas are followed by a space <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.cssLiteral || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.cssLiteral(line) ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('refrain from using css literals') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> <span class="cstat-no" title="statement not covered" > return;</span> } } &nbsp; // check for brackets (except in hash) <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.brackets || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.brackets( line, app.state.hash ) &amp;&amp; !app.state.cssBlock ) { app.warnings.push( chalk.yellow('unecessary bracket') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check that commas are followed by a space <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.commaSpace || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.commaStyleCorrect(line) === false ) { app.warnings.push( chalk.yellow('commas must be followed by a space for readability') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check that commas are followed by a space <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.duplicates || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.duplicates( line, file ) ) { app.warnings.push( chalk.yellow('duplicate property or selector, consider merging') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check for extra spaces when using parens <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.mixinSpace || app.config.parenSpace || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.parenStyleCorrect(line) === false ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('( param1, param2 ) is preferred over (param1, param2)') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } &nbsp; // check for border none (prefer border 0) <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.borderNone || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.checkBorderNone(line) ) { app.warnings.push( chalk.yellow('border 0 is preferred over border none') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check for border none (prefer border 0) <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.leadingZero || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.leadingZero( line, arr ) ) { app.warnings.push( chalk.yellow('leading zeros for decimal points are unecessary') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check for @block when defining block var <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.enforceBlockStyle || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.blockStyleCorrect(line) === false ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('block variables must include @block') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } &nbsp; // check for @extend(s) preference <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.extendPref || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.state.strictMode &amp;&amp; app.config.extendPref === false ) {</span> <span class="cstat-no" title="statement not covered" > app.config.extendPref = '@extends';</span> } &nbsp; <span class="cstat-no" title="statement not covered" > if ( app.extendStyleCorrect(line, app.config.extendPref) === false ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('please use the ' + app.config.extendPref + ' syntax when extending') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } &nbsp; // check for naming convention preference <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.namingConvention || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.state.strictMode &amp;&amp; app.config.namingConvention === false ) {</span> <span class="cstat-no" title="statement not covered" > app.config.namingConvention = 'lowercase-dash';</span> } &nbsp; <span class="cstat-no" title="statement not covered" > if ( app.namingConvention(line, app.config.namingConvention) === false ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('preferred naming convention is ' + app.config.namingConvention) + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } &nbsp; // only extend placeholder vars (or not) <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.placeholders || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.placeholderStyleCorrect(line) === false ) { app.warnings.push( chalk.yellow('please extend only placeholder vars') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check for $ at start of var <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.enforceVarStyle || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.varStyleCorrect(line) === false ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('variables must be prefixed with the $ sign.') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } &nbsp; // check for * selector (* is discouraged) <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.universal || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.universalSelector(line) ) { app.warnings.push( chalk.yellow('* selector is slow. Consider a different selector.') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check for unecessary : (margin 0 is preferred over margin: 0) <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.colons || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.colon( line, app.state.hash ) ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('unecessary colon found:') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } &nbsp; // check for unecessary ; (margin 0; is invalid) <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.semicolons || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.semicolon(line) ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('unecessary semicolon found:') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } &nbsp; // check for places where we can be more efficient (margin 0 50px vs margin 0 50px 0 50px) <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.efficient || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.efficient( line, arr ) === false ) { app.warnings.push( chalk.yellow('the value on this line could be more succinct:') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check mixed spaces and tabs <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.mixed || app.state.strictMode ) { // console.log( app.config.indentSpaces ); // else check tabs against tabs and spaces against spaces <span class="cstat-no" title="statement not covered" > if ( app.mixedSpacesAndTabs( line, arr, app.config.indentSpaces ) ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('mixed spaces and tabs') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } &nbsp; // check for trailing whitespace <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.trailingWhitespace || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.whitespace( line ) ) { app.warnings.push( chalk.yellow('trailing whitespace') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check selector depth <span class="missing-if-branch" title="if path not taken" >I</span>if ( app.config.depthLimit || app.state.strictMode ) { <span class="cstat-no" title="statement not covered" > if ( app.state.strictMode &amp;&amp; app.config.depthLimit === false ) {</span> <span class="cstat-no" title="statement not covered" > app.config.depthLimit = 4;</span> } // else check tabs against tabs and spaces against spaces <span class="cstat-no" title="statement not covered" > if ( app.tooMuchNest( line, arr ) ) {</span> <span class="cstat-no" title="statement not covered" > app.warnings.push( chalk.yellow('selector depth greater than', app.config.depthLimit + ':') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output );</span> } } &nbsp; // check valid properties and values <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.valid || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.validProperty( line, valid ) === false ) { app.warnings.push( chalk.yellow('property is not valid') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } // if ( validValue( line, arr, validCSS, validHTML ) === false ) { // app.warnings.push( chalk.yellow('value is not valid') + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); // } } &nbsp; // check for 0px (margin 0 is preferred over margin 0px | 0em | 0whatever) <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.zeroUnits || <span class="branch-1 cbranch-no" title="branch not covered" >app.config.unecessaryPx </span>|| <span class="branch-2 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.zeroUnits(line) ) { app.warnings.push( chalk.yellow( '0 is preferred. Unit value is unnecessary' ) + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; // check for 0px (margin 0 is preferred over margin 0px | 0em | 0whatever) <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.zIndexDuplicates || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { &nbsp; if ( app.deDupeZ( line ) ) { app.warnings.push( chalk.yellow( 'this z-index value is already being used elsewhere' ) + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } &nbsp; <span class="missing-if-branch" title="else path not taken" >E</span>if ( app.config.zIndexNormalize || <span class="branch-1 cbranch-no" title="branch not covered" >app.state.strictMode </span>) { if ( app.normalizeZ( line ) ) { app.warnings.push( chalk.yellow( 'this z-index value is not normalized' ) + '\nFile: ' + file + '\nLine: ' + num + ': ' + output ); } } } } }</pre></td></tr> </table></pre> </div> <div class="footer"> <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Jan 26 2015 22:26:28 GMT-0800 (PST)</div> </div> <script src="../../prettify.js"></script> <script src="https://yui-s.yahooapis.com/3.6.0/build/yui/yui-min.js"></script> <script> YUI().use('datatable', function (Y) { var formatters = { pct: function (o) { o.className += o.record.get('classes')[o.column.key]; try { return o.value.toFixed(2) + '%'; } catch (ex) { return o.value + '%'; } }, html: function (o) { o.className += o.record.get('classes')[o.column.key]; return o.record.get(o.column.key + '_html'); } }, defaultFormatter = function (o) { o.className += o.record.get('classes')[o.column.key]; return o.value; }; function getColumns(theadNode) { var colNodes = theadNode.all('tr th'), cols = [], col; colNodes.each(function (colNode) { col = { key: colNode.getAttribute('data-col'), label: colNode.get('innerHTML') || ' ', sortable: !colNode.getAttribute('data-nosort'), className: colNode.getAttribute('class'), type: colNode.getAttribute('data-type'), allowHTML: colNode.getAttribute('data-html') === 'true' || colNode.getAttribute('data-fmt') === 'html' }; col.formatter = formatters[colNode.getAttribute('data-fmt')] || defaultFormatter; cols.push(col); }); return cols; } function getRowData(trNode, cols) { var tdNodes = trNode.all('td'), i, row = { classes: {} }, node, name; for (i = 0; i < cols.length; i += 1) { name = cols[i].key; node = tdNodes.item(i); row[name] = node.getAttribute('data-value') || node.get('innerHTML'); row[name + '_html'] = node.get('innerHTML'); row.classes[name] = node.getAttribute('class'); //Y.log('Name: ' + name + '; Value: ' + row[name]); if (cols[i].type === 'number') { row[name] = row[name] * 1; } } //Y.log(row); return row; } function getData(tbodyNode, cols) { var data = []; tbodyNode.all('tr').each(function (trNode) { data.push(getRowData(trNode, cols)); }); return data; } function replaceTable(node) { if (!node) { return; } var cols = getColumns(node.one('thead')), data = getData(node.one('tbody'), cols), table, parent = node.get('parentNode'); table = new Y.DataTable({ columns: cols, data: data, sortBy: 'file' }); parent.set('innerHTML', ''); table.render(parent); } Y.on('domready', function () { replaceTable(Y.one('div.coverage-summary table')); if (typeof prettyPrint === 'function') { prettyPrint(); } }); }); </script> </body> </html>