Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/formatters/compact.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
1 change: 1 addition & 0 deletions src/rules/adjoining-classes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/box-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/box-sizing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],

Expand Down
1 change: 1 addition & 0 deletions src/rules/bulletproof-font-face.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/compatible-vendor-prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/display-property-grouping.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/duplicate-background-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/duplicate-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/empty-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/fallback-colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/floats.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/font-faces.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/font-sizes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/gradients.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CSSLint.addRule({
id: "import",
name: "Disallow @import",
desc: "Don't use @import, use <link> instead.",
url: "https://github.com/CSSLint/csslint/wiki/Disallow-%40import",
browsers: "All",

//initialization
Expand Down
1 change: 1 addition & 0 deletions src/rules/important.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/known-properties.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/outline-none.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"],

Expand Down
1 change: 1 addition & 0 deletions src/rules/overqualified-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/qualified-headings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/regex-selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/shorthand.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/star-property-hack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/text-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/underscore-property-hack.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/unique-headings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/universal-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/unqualified-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/vendor-prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/rules/zero-units.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions tests/formatters/compact.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,27 @@
"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);
},

"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);
}
Expand Down