Skip to content
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

Add ignore option #27

Merged
merged 5 commits into from
Jul 27, 2016
Merged

Conversation

alexlafroscia
Copy link
Contributor

Closes #23

@alexlafroscia
Copy link
Contributor Author

I swapped out node-glob for walk-sync with these changes in that PR that I'm working on, and it's quite a bit faster! The ember-cli-eslint install time (that does the search for .jshintrc files) runs in 3.35s instead of 5.75s so I'm happy with that.

@@ -84,14 +89,15 @@ function _walkSync(baseDir, options, _relativePath) {

for (var i=0; i<sortedEntries.length; ++i) {
var entry = sortedEntries[i];
var isIgnored = (ignoreMatcher && ignoreMatcher.match(entry.relativePath));

Copy link
Collaborator

@stefanpenner stefanpenner Jul 26, 2016

Choose a reason for hiding this comment

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

Should we simply do if (isIgnored) { continue; }, that should somewhat simplify the code the follows.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Absolutely, makes sense.

@@ -84,14 +89,17 @@ function _walkSync(baseDir, options, _relativePath) {

for (var i=0; i<sortedEntries.length; ++i) {
var entry = sortedEntries[i];
if (ignoreMatcher && ignoreMatcher.match(entry.relativePath)) {
Copy link
Collaborator

@stefanpenner stefanpenner Jul 26, 2016

Choose a reason for hiding this comment

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

Although correct, we may want to do this check between line 67 and 68. This prevents us from doing the costly getStat, and to a lesser degree allocation of the new Entry object for something we will drop anyways.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I see... Prevent it from ever being added to entries instead, right? Makes sense to me.

@stefanpenner
Copy link
Collaborator

@alexlafroscia perfect, thank you!

@stefanpenner stefanpenner merged commit 9a2eb7a into joliss:master Jul 27, 2016
@stefanpenner
Copy link
Collaborator

stefanpenner commented Jul 27, 2016

released as v0.3.0, thank you kindly.

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.

2 participants