Skip to content

Commit

Permalink
Merge pull request #83 from codeclimate/will/rm-exclude-paths-support
Browse files Browse the repository at this point in the history
Remove `exclude_paths` support
  • Loading branch information
wfleming committed Mar 15, 2016
2 parents 6fe9de1 + c6dc243 commit b6a4060
Showing 1 changed file with 2 additions and 29 deletions.
31 changes: 2 additions & 29 deletions bin/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,30 +105,6 @@ function prunePathsWithinSymlinks(paths) {
});
}

function exclusionBasedFileListBuilder(excludePaths) {
// Uses glob to traverse code directory and find files to analyze,
// excluding files passed in with by CLI config, and including only
// files in the list of desired extensions.
//
// Deprecated style of file expansion, supported for users of the old CLI.
return function(extensions) {
var analysisFiles = [];
var allFiles = glob.sync("/code/**/**", {});

prunePathsWithinSymlinks(allFiles).forEach(function(file, i, a){
if(excludePaths.indexOf(file.split("/code/")[1]) < 0) {
if(fs.lstatSync(file).isFile()) {
if (!isFileIgnoredByLibrary(file) && isFileWithMatchingExtension(file, extensions)) {
analysisFiles.push(file);
}
}
}
});

return analysisFiles;
};
}

function inclusionBasedFileListBuilder(includePaths) {
// Uses glob to expand the files and directories in includePaths, filtering
// down to match the list of desired extensions.
Expand Down Expand Up @@ -168,12 +144,9 @@ runWithTiming("engineConfig", function () {
buildFileList = inclusionBasedFileListBuilder(
engineConfig.include_paths
);
} else if (engineConfig.exclude_paths) {
var ignores = engineConfig.exclude_paths;
buildFileList = exclusionBasedFileListBuilder(ignores);
} else {
// No includes or excludes, let's try with everything
buildFileList = exclusionBasedFileListBuilder([]);
// No explicit includes, let's try with everything
buildFileList = inclusionBasedFileListBuilder(["./"]);
}

var userConfig = engineConfig.config || {};
Expand Down

0 comments on commit b6a4060

Please sign in to comment.