diff --git a/docs/cli.md b/docs/cli.md index 3714e5a..28280c3 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -76,7 +76,7 @@ This will traverse the `packages` directory, looking at files and subdirectories ***Ignoring*** -Files inside _any_ `node_modules` directory are _always_ ignored. +Any file or directory names matching `node_modules` or `^.git` are _always_ ignored. You can use the `-i/--ignore` flags to provide additional patterns to ignore. Much like `[pattern]`, these values are cast to a `RegExp`, allowing you to be as vague or specific as you need to be. diff --git a/src/parse.js b/src/parse.js index 9bcbc2a..c884ce4 100644 --- a/src/parse.js +++ b/src/parse.js @@ -19,7 +19,7 @@ export async function parse(dir, pattern, opts = {}) { let suites = []; let requires = [].concat(opts.require || []).filter(Boolean); - let ignores = ['node_modules'].concat(opts.ignore || []).map(toRegex); + let ignores = ['^.git', 'node_modules'].concat(opts.ignore || []).map(toRegex); requires.forEach(name => { let tmp = exists(name);