Skip to content

Update to handle config.include_paths or config.exclude_paths. #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 11, 2015

Conversation

fhwang
Copy link
Contributor

@fhwang fhwang commented Sep 10, 2015

For the time being, engines need to support both the old include_paths and the new exclude_paths keys in config.json. This PR represents that requirement.

// Deprecated style of file expansion, supported for users of the old CLI.
return function(extensions) {
var analysisFiles = [];
var allFiles = glob.sync("/code/**/**", {});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the exact call that errors when something has restrictive permissions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: nevermind this is the deprecated function

analysisFiles.push(file);
function isFileWithMatchingExtension(file, extensions) {
var stats = fs.lstatSync(file);
var extension = "." + file.split(".").pop();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any considering to be made for (e.g.) foo.tar.gz or index.html.slim?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line returns the last fragment in the string, i.e. .gz or .slim. So I think this is what we want. Even in a case where js is in the middle of the string, such as application.js.erb, we wouldn't to consider that analyzable by ESLint.

@pbrisbin
Copy link
Contributor

LGTM

fhwang added a commit that referenced this pull request Sep 11, 2015
Update to handle config.include_paths or config.exclude_paths.
@fhwang fhwang merged commit 0e39d21 into master Sep 11, 2015
@fhwang fhwang deleted the include-paths-or-exclude-paths branch September 11, 2015 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants