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

option to ignore directories #6

Closed
dylang opened this issue Jun 3, 2014 · 4 comments
Closed

option to ignore directories #6

dylang opened this issue Jun 3, 2014 · 4 comments

Comments

@dylang
Copy link
Contributor

dylang commented Jun 3, 2014

Right now depcheck walks every directory except node_modules

finder.on("directory", function (dir) {
    if (path.basename(dir) === "node_modules") {
      return;
    }
    directories.push(dir);
  });

It would be helpful if we could provide an array of directories to ignore so we could avoid scanning our build directory which happens to be huge.

For example

depcheck(root, {
    ignoreDirs: [ 
        // node_modules is assumed
        'build',
        'bower_components'
    ]  
    }, cb);
@dylang
Copy link
Contributor Author

dylang commented Jun 9, 2014

I thought of a more automatic way to do this...

What do you think about ignoring all files/directories in .gitignore?

I could make a pull request for this if you like the idea.

@rumpl
Copy link
Member

rumpl commented Jun 9, 2014

It's an interesting idea, however, not everyone is using git for their projects, must not forget people using svn, mercurial or any other VCS :)

So yeah, I like the first one better where people can add manually what direcotries depecheck should ignore.

I'm sorry I didn't respond to this issue soone, had plenty of work and not enough time...

Feel free to send a PR if you want this feature to come sooner than later.

@dylang
Copy link
Contributor Author

dylang commented Jun 9, 2014

Great point about those other source control systems that I tend to forget exist.

Totally understand about not having time, no worries! I'm using your project for a "when I have time" project too, and with two kids and a busy job, it's difficult to find time. I'll try to make a PR but no promises on when I will get it done.

Here's what I've been building: https://github.com/dylang/npm-check

@dylang dylang mentioned this issue Jun 11, 2014
@rumpl
Copy link
Member

rumpl commented Jun 14, 2014

Guess we can close this one thanks to your PR.

Thanks

@rumpl rumpl closed this as completed Jun 14, 2014
dylang pushed a commit to dylang/depcheck that referenced this issue Oct 14, 2015
Allow passing ignores via the command line.
rumpl pushed a commit that referenced this issue Aug 21, 2023
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

No branches or pull requests

2 participants