-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Fix: Always ignore defaults unless explicitly passed (fixes #5547) #5820
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -219,6 +219,50 @@ describe("globUtil", function() { | |
]); | ||
}); | ||
|
||
it("should silently ignore default ignored files if not passed explicitly", function() { | ||
var directory = getFixturePath("glob-util", "hidden"); | ||
var patterns = [directory]; | ||
var result = globUtil.listFilesToProcess(patterns, { | ||
cwd: getFixturePath() | ||
}); | ||
|
||
assert.equal(result.length, 0); | ||
}); | ||
|
||
it("should ignore and warn for default ignored files when passed explicitly", function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's the big we are fixing here, no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we may be getting mixed up on a few related issues. This PR is to fix #5547, which is to say, to keep ignoring default-ignored files even if the The current behavior has always been to print a warning if an explicitly passed file is ignored due to an ignore rule. #4828 (comment) is a separate issue and will need greater structural changes to accomplish. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure we should add a test for a behaviour we think is a bug, but yeah, it's a different issue. |
||
var filename = getFixturePath("glob-util", "hidden", ".foo.js"); | ||
var patterns = [filename]; | ||
var result = globUtil.listFilesToProcess(patterns, { | ||
cwd: getFixturePath() | ||
}); | ||
|
||
assert.equal(result.length, 1); | ||
assert.deepEqual(result[0], { filename: filename, ignored: true }); | ||
}); | ||
|
||
it("should silently ignore default ignored files if not passed explicitly even if ignore is false", function() { | ||
var directory = getFixturePath("glob-util", "hidden"); | ||
var patterns = [directory]; | ||
var result = globUtil.listFilesToProcess(patterns, { | ||
cwd: getFixturePath(), | ||
ignore: false | ||
}); | ||
|
||
assert.equal(result.length, 0); | ||
}); | ||
|
||
it("should not ignore default ignored files when passed explicitly if ignore is false", function() { | ||
var filename = getFixturePath("glob-util", "hidden", ".foo.js"); | ||
var patterns = [filename]; | ||
var result = globUtil.listFilesToProcess(patterns, { | ||
cwd: getFixturePath(), | ||
ignore: false | ||
}); | ||
|
||
assert.equal(result.length, 1); | ||
assert.deepEqual(result[0], { filename: filename, ignored: false }); | ||
}); | ||
|
||
it("should not return a file which does not exist", function() { | ||
var patterns = ["tests/fixtures/glob-util/hidden/bar.js"]; | ||
var result = globUtil.listFilesToProcess(patterns); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as above here regarding explicitly passed files.