MCPcopy Create free account
hub / github.com/CSSLint/csslint / gatherRules

Function gatherRules

src/cli/common.js:46–65  ·  view source on GitHub ↗

* Returns a ruleset object based on the CLI options. * @param options {Object} The CLI options. * @return {Object} A ruleset object.

(options, ruleset)

Source from the content-addressed store, hash-verified

44 * @return {Object} A ruleset object.
45 */
46 function gatherRules(options, ruleset) {
47 var warnings = options.rules || options.warnings,
48 errors = options.errors;
49
50 if (warnings) {
51 ruleset = ruleset || {};
52 warnings.split(",").forEach(function(value) {
53 ruleset[value] = 1;
54 });
55 }
56
57 if (errors) {
58 ruleset = ruleset || {};
59 errors.split(",").forEach(function(value) {
60 ruleset[value] = 2;
61 });
62 }
63
64 return ruleset;
65 }
66
67 /**
68 * Filters out rules using the ignore command line option.

Callers 1

processFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…