diff --git a/src/formatters/compact.js b/src/formatters/compact.js index ef86148d..e6c3ae0b 100644 --- a/src/formatters/compact.js +++ b/src/formatters/compact.js @@ -49,7 +49,7 @@ CSSLint.addFormatter({ CSSLint.Util.forEach(messages, function(message) { if (message.rollup) { - output += filename + ": " + capitalize(message.type) + " - " + message.message + "\n"; + output += filename + ": " + capitalize(message.type) + " - " + message.message + " (" + message.rule.id + ")\n"; } else { output += filename + ": " + "line " + message.line + ", col " + message.col + ", " + capitalize(message.type) + " - " + message.message + " (" + message.rule.id + ")\n"; diff --git a/src/rules/adjoining-classes.js b/src/rules/adjoining-classes.js index 5f335034..d203f60e 100644 --- a/src/rules/adjoining-classes.js +++ b/src/rules/adjoining-classes.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "adjoining-classes", name: "Disallow adjoining classes", desc: "Don't use adjoining classes.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-adjoining-classes", browsers: "IE6", //initialization diff --git a/src/rules/box-model.js b/src/rules/box-model.js index 9bd1fef8..e970f21a 100644 --- a/src/rules/box-model.js +++ b/src/rules/box-model.js @@ -7,6 +7,7 @@ CSSLint.addRule({ id: "box-model", name: "Beware of broken box size", desc: "Don't use width or height when using padding or border.", + url: "https://github.com/CSSLint/csslint/wiki/Beware-of-box-model-size", browsers: "All", //initialization diff --git a/src/rules/box-sizing.js b/src/rules/box-sizing.js index d6a34816..eed0a7c2 100644 --- a/src/rules/box-sizing.js +++ b/src/rules/box-sizing.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "box-sizing", name: "Disallow use of box-sizing", desc: "The box-sizing properties isn't supported in IE6 and IE7.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-box-sizing", browsers: "IE6, IE7", tags: ["Compatibility"], diff --git a/src/rules/bulletproof-font-face.js b/src/rules/bulletproof-font-face.js index c5c67d7e..f7b67bc2 100644 --- a/src/rules/bulletproof-font-face.js +++ b/src/rules/bulletproof-font-face.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "bulletproof-font-face", name: "Use the bulletproof @font-face syntax", desc: "Use the bulletproof @font-face syntax to avoid 404's in old IE (http://www.fontspring.com/blog/the-new-bulletproof-font-face-syntax).", + url: "https://github.com/CSSLint/csslint/wiki/Bulletproof-font-face", browsers: "All", //initialization diff --git a/src/rules/compatible-vendor-prefixes.js b/src/rules/compatible-vendor-prefixes.js index ba86bb56..273c80af 100644 --- a/src/rules/compatible-vendor-prefixes.js +++ b/src/rules/compatible-vendor-prefixes.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "compatible-vendor-prefixes", name: "Require compatible vendor prefixes", desc: "Include all compatible vendor prefixes to reach a wider range of users.", + url: "https://github.com/CSSLint/csslint/wiki/Require-compatible-vendor-prefixes", browsers: "All", //initialization diff --git a/src/rules/display-property-grouping.js b/src/rules/display-property-grouping.js index ab4a2fc6..0ffad6b0 100644 --- a/src/rules/display-property-grouping.js +++ b/src/rules/display-property-grouping.js @@ -12,6 +12,7 @@ CSSLint.addRule({ id: "display-property-grouping", name: "Require properties appropriate for display", desc: "Certain properties shouldn't be used with certain display property values.", + url: "https://github.com/CSSLint/csslint/wiki/Require-properties-appropriate-for-display", browsers: "All", //initialization diff --git a/src/rules/duplicate-background-images.js b/src/rules/duplicate-background-images.js index b476e750..53ff4947 100644 --- a/src/rules/duplicate-background-images.js +++ b/src/rules/duplicate-background-images.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "duplicate-background-images", name: "Disallow duplicate background images", desc: "Every background-image should be unique. Use a common class for e.g. sprites.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-duplicate-background-images", browsers: "All", //initialization diff --git a/src/rules/duplicate-properties.js b/src/rules/duplicate-properties.js index 239a46f0..3f342320 100644 --- a/src/rules/duplicate-properties.js +++ b/src/rules/duplicate-properties.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "duplicate-properties", name: "Disallow duplicate properties", desc: "Duplicate properties must appear one after the other.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-duplicate-properties", browsers: "All", //initialization diff --git a/src/rules/empty-rules.js b/src/rules/empty-rules.js index 2f9c94c9..aa9f8b44 100644 --- a/src/rules/empty-rules.js +++ b/src/rules/empty-rules.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "empty-rules", name: "Disallow empty rules", desc: "Rules without any properties specified should be removed.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-empty-rules", browsers: "All", //initialization diff --git a/src/rules/fallback-colors.js b/src/rules/fallback-colors.js index f3498ca3..8511ef09 100644 --- a/src/rules/fallback-colors.js +++ b/src/rules/fallback-colors.js @@ -4,6 +4,7 @@ CSSLint.addRule({ id: "fallback-colors", name: "Require fallback colors", desc: "For older browsers that don't support RGBA, HSL, or HSLA, provide a fallback color.", + url: "https://github.com/CSSLint/csslint/wiki/Require-fallback-colors", browsers: "IE6,IE7,IE8", //initialization diff --git a/src/rules/floats.js b/src/rules/floats.js index 098c9254..c49ef389 100644 --- a/src/rules/floats.js +++ b/src/rules/floats.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "floats", name: "Disallow too many floats", desc: "This rule tests if the float property is used too many times", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-too-many-floats", browsers: "All", //initialization diff --git a/src/rules/font-faces.js b/src/rules/font-faces.js index b349cd27..2d49cfd1 100644 --- a/src/rules/font-faces.js +++ b/src/rules/font-faces.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "font-faces", name: "Don't use too many web fonts", desc: "Too many different web fonts in the same stylesheet.", + url: "https://github.com/CSSLint/csslint/wiki/Don%27t-use-too-many-web-fonts", browsers: "All", //initialization diff --git a/src/rules/font-sizes.js b/src/rules/font-sizes.js index 85b06cff..8341513d 100644 --- a/src/rules/font-sizes.js +++ b/src/rules/font-sizes.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "font-sizes", name: "Disallow too many font sizes", desc: "Checks the number of font-size declarations.", + url: "https://github.com/CSSLint/csslint/wiki/Don%27t-use-too-many-font-size-declarations", browsers: "All", //initialization diff --git a/src/rules/gradients.js b/src/rules/gradients.js index 2e0fa22c..a35e1deb 100644 --- a/src/rules/gradients.js +++ b/src/rules/gradients.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "gradients", name: "Require all gradient definitions", desc: "When using a vendor-prefixed gradient, make sure to use them all.", + url: "https://github.com/CSSLint/csslint/wiki/Require-all-gradient-definitions", browsers: "All", //initialization diff --git a/src/rules/ids.js b/src/rules/ids.js index 28890395..e3da4a34 100644 --- a/src/rules/ids.js +++ b/src/rules/ids.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "ids", name: "Disallow IDs in selectors", desc: "Selectors should not contain IDs.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-IDs-in-selectors", browsers: "All", //initialization diff --git a/src/rules/import.js b/src/rules/import.js index 4f0a5435..fbba9cc8 100644 --- a/src/rules/import.js +++ b/src/rules/import.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "import", name: "Disallow @import", desc: "Don't use @import, use instead.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-%40import", browsers: "All", //initialization diff --git a/src/rules/important.js b/src/rules/important.js index b7436660..9efa3894 100644 --- a/src/rules/important.js +++ b/src/rules/important.js @@ -10,6 +10,7 @@ CSSLint.addRule({ id: "important", name: "Disallow !important", desc: "Be careful when using !important declaration", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-%21important", browsers: "All", //initialization diff --git a/src/rules/known-properties.js b/src/rules/known-properties.js index b56fa9e2..b403b5f1 100644 --- a/src/rules/known-properties.js +++ b/src/rules/known-properties.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "known-properties", name: "Require use of known properties", desc: "Properties should be known (listed in CSS3 specification) or be a vendor-prefixed property.", + url: "https://github.com/CSSLint/csslint/wiki/Require-use-of-known-properties", browsers: "All", //initialization diff --git a/src/rules/outline-none.js b/src/rules/outline-none.js index dc0c9657..dc2c32ca 100644 --- a/src/rules/outline-none.js +++ b/src/rules/outline-none.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "outline-none", name: "Disallow outline: none", desc: "Use of outline: none or outline: 0 should be limited to :focus rules.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-outline%3Anone", browsers: "All", tags: ["Accessibility"], diff --git a/src/rules/overqualified-elements.js b/src/rules/overqualified-elements.js index 13e21274..5568364a 100644 --- a/src/rules/overqualified-elements.js +++ b/src/rules/overqualified-elements.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "overqualified-elements", name: "Disallow overqualified elements", desc: "Don't use classes or IDs with elements (a.foo or a#foo).", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-overqualified-elements", browsers: "All", //initialization diff --git a/src/rules/qualified-headings.js b/src/rules/qualified-headings.js index bdb46470..32bd662d 100644 --- a/src/rules/qualified-headings.js +++ b/src/rules/qualified-headings.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "qualified-headings", name: "Disallow qualified headings", desc: "Headings should not be qualified (namespaced).", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-qualified-headings", browsers: "All", //initialization diff --git a/src/rules/regex-selectors.js b/src/rules/regex-selectors.js index 2ab10bb3..cc1cd54e 100644 --- a/src/rules/regex-selectors.js +++ b/src/rules/regex-selectors.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "regex-selectors", name: "Disallow selectors that look like regexs", desc: "Selectors that look like regular expressions are slow and should be avoided.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-selectors-that-look-like-regular-expressions", browsers: "All", //initialization diff --git a/src/rules/shorthand.js b/src/rules/shorthand.js index 2be71a86..ac2f44c3 100644 --- a/src/rules/shorthand.js +++ b/src/rules/shorthand.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "shorthand", name: "Require shorthand properties", desc: "Use shorthand properties where possible.", + url: "https://github.com/CSSLint/csslint/wiki/Require-shorthand-properties", browsers: "All", //initialization diff --git a/src/rules/star-property-hack.js b/src/rules/star-property-hack.js index 7663674f..a6bb6827 100644 --- a/src/rules/star-property-hack.js +++ b/src/rules/star-property-hack.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "star-property-hack", name: "Disallow properties with a star prefix", desc: "Checks for the star property hack (targets IE6/7)", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-star-hack", browsers: "All", //initialization diff --git a/src/rules/text-indent.js b/src/rules/text-indent.js index 17536bab..80643b40 100644 --- a/src/rules/text-indent.js +++ b/src/rules/text-indent.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "text-indent", name: "Disallow negative text-indent", desc: "Checks for text indent less than -99px", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-negative-text-indent", browsers: "All", //initialization diff --git a/src/rules/underscore-property-hack.js b/src/rules/underscore-property-hack.js index de29017d..bed30fe9 100644 --- a/src/rules/underscore-property-hack.js +++ b/src/rules/underscore-property-hack.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "underscore-property-hack", name: "Disallow properties with an underscore prefix", desc: "Checks for the underscore property hack (targets IE6)", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-underscore-hack", browsers: "All", //initialization diff --git a/src/rules/unique-headings.js b/src/rules/unique-headings.js index 978510f2..b83c5c67 100644 --- a/src/rules/unique-headings.js +++ b/src/rules/unique-headings.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "unique-headings", name: "Headings should only be defined once", desc: "Headings should be defined only once.", + url: "https://github.com/CSSLint/csslint/wiki/Headings-should-only-be-defined-once", browsers: "All", //initialization diff --git a/src/rules/universal-selector.js b/src/rules/universal-selector.js index c3fd4b9d..8e1a29fe 100644 --- a/src/rules/universal-selector.js +++ b/src/rules/universal-selector.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "universal-selector", name: "Disallow universal selector", desc: "The universal selector (*) is known to be slow.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-universal-selector", browsers: "All", //initialization diff --git a/src/rules/unqualified-attributes.js b/src/rules/unqualified-attributes.js index 88fbd3ff..3472f0b3 100644 --- a/src/rules/unqualified-attributes.js +++ b/src/rules/unqualified-attributes.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "unqualified-attributes", name: "Disallow unqualified attribute selectors", desc: "Unqualified attribute selectors are known to be slow.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-unqualified-attribute-selectors", browsers: "All", //initialization diff --git a/src/rules/vendor-prefix.js b/src/rules/vendor-prefix.js index 166ec89f..7c487b60 100644 --- a/src/rules/vendor-prefix.js +++ b/src/rules/vendor-prefix.js @@ -9,6 +9,7 @@ CSSLint.addRule({ id: "vendor-prefix", name: "Require standard property with vendor prefix", desc: "When using a vendor-prefixed property, make sure to include the standard one.", + url: "https://github.com/CSSLint/csslint/wiki/Require-standard-property-with-vendor-prefix", browsers: "All", //initialization diff --git a/src/rules/zero-units.js b/src/rules/zero-units.js index f86e9bf0..dc308339 100644 --- a/src/rules/zero-units.js +++ b/src/rules/zero-units.js @@ -8,6 +8,7 @@ CSSLint.addRule({ id: "zero-units", name: "Disallow units for 0 values", desc: "You don't need to specify units when a value is 0.", + url: "https://github.com/CSSLint/csslint/wiki/Disallow-units-for-zero-values", browsers: "All", //initialization diff --git a/tests/formatters/compact.js b/tests/formatters/compact.js index 78e409d0..1a2ca851 100644 --- a/tests/formatters/compact.js +++ b/tests/formatters/compact.js @@ -20,11 +20,13 @@ "File with problems should list them": function() { var result = { messages: [ { type: "error", line: 2, col: 1, message: "BOGUS ERROR", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } }, - { type: "warning", line: 1, col: 1, message: "BOGUS WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } } + { type: "warning", line: 1, col: 1, message: "BOGUS WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } }, + { type: "warning", rollup: true, message: "BOGUS ROLLUP WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } } ], stats: [] }, err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR (BOGUS_RULE_ID)\n", warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING (BOGUS_RULE_ID)\n", - expected = err + warning, + rollupwarning = "path/to/FILE: Warning - BOGUS ROLLUP WARNING (BOGUS_RULE_ID)\n", + expected = err + warning + rollupwarning, actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"}); Assert.areEqual(expected, actual); }, @@ -32,11 +34,13 @@ "Should output relative file paths": function() { var result = { messages: [ { type: "error", line: 2, col: 1, message: "BOGUS ERROR", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } }, - { type: "warning", line: 1, col: 1, message: "BOGUS WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } } + { type: "warning", line: 1, col: 1, message: "BOGUS WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } }, + { type: "warning", rollup: true, message: "BOGUS ROLLUP WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } } ], stats: [] }, err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR (BOGUS_RULE_ID)\n", warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING (BOGUS_RULE_ID)\n", - expected = err + warning, + rollupwarning = "path/to/FILE: Warning - BOGUS ROLLUP WARNING (BOGUS_RULE_ID)\n", + expected = err + warning + rollupwarning, actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"}); Assert.areEqual(expected, actual); }