-
Notifications
You must be signed in to change notification settings - Fork 20
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
What kind of input does ignoreFiles expect? #11
Comments
The sample on the overview page shows RegExp objects. This is straight from the source code: function shouldIgnore(file) {
return !_.some(options.ignoreFiles, function(ignore) {
return ignore.test(file);
});
} So |
I should have known that. Thanks for the reply! On 03-09-15 02:49, Evo Stamatov wrote:
|
By the way, I think it would be a lot simpler to switch to a filter that only process files that match it. Not the other way around, like it currently is. With the current ignoreFiles option I have to use this regex:
Whereas a |
@avioli Thanks for helping out and showing what needs to be done. @ismay That's a great addition. You open to making a pull request that adds that as an option? And |
I don't know. I think the only way for such a new option to work is if it completely replaced the But that would be a breaking change. I'd be up for submitting a pr, but I haven't had much luck with getting this plugin to work. If you could write some tests for the basic functionality I wouldn't mind taking a look at it. |
One solution, which would be quite easy, is to add function plugin(options) {
//...
defaultsDeep(options, {
ignoreFiles: [],
onlyIncludeFiles: [/./], // will include all files by default
//...
function shouldInclude(file) {
return _.some(options.onlyIncludeFiles, function(ignore) {
return ignore.test(file);
});
} An alternative is to use this RegExp: It uses Positive lookahead group construct to match without consuming characters, but has an issue that it cannot match strictly end of line, so Here is a fiddle, you can play around and see what I mean with the |
I just saw the refactor, so sorry if this isn't helpful at all. I believe the plugin should remain as simple as possible, so whatever @boushley decides is fine by me. |
@avioli np, simplicity is what I'm going for as well. That and a user friendly API. |
It would make sense for it to accept an array of minimatch strings, but that does not seem to be the case. So what does it accept? I couldn't find it in the documentation.
The text was updated successfully, but these errors were encountered: