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

Function filterFiles

src/cli/common.js:93–120  ·  view source on GitHub ↗

* Filters out files using the exclude-list command line option. * @param files {Array} the list of files to check for exclusions * @param options {Object} the CLI options * @return {Array} A list of files

(files, options)

Source from the content-addressed store, hash-verified

91 * @return {Array} A list of files
92 */
93 function filterFiles(files, options) {
94 var excludeList = options["exclude-list"],
95 excludeFiles = [],
96 filesToLint = files.map(api.getFullPath),
97 fullPath;
98
99
100 if (excludeList) {
101 // Build up the exclude list, expanding any directory exclusions that were passed in
102 excludeList.split(",").forEach(function(value) {
103 if (api.isDirectory(value)) {
104 excludeFiles = excludeFiles.concat(api.getFiles(value));
105 } else {
106 excludeFiles.push(value);
107 }
108 });
109
110 // Remove the excluded files from the list of files to lint
111 excludeFiles.forEach(function(value) {
112 fullPath = api.getFullPath(value);
113 if (filesToLint.indexOf(fullPath) > -1) {
114 filesToLint.splice(filesToLint.indexOf(fullPath), 1);
115 }
116 });
117 }
118
119 return filesToLint;
120 }
121
122 /**
123 * Outputs all available rules to the CLI.

Callers 1

processFilesFunction · 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…