-
-
Notifications
You must be signed in to change notification settings - Fork 133
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 ignoreFiles
option
#172
Conversation
You need to update package.json when renaming a file. |
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.
Addressed all comments, and made sure to undo any autoformatting (sorry about that).
5cdec2e
to
08212ee
Compare
48605e7
to
662cafc
Compare
How can I help getting this PR merged into the project? |
This is very similar to the `gitignore` option, except it allows globing for any compatible ignore file (eg, `.prettierignore` or `.eslintignore`).
08212ee
to
acf4499
Compare
I've rebased, this just requires a review. |
const {cwd} = normalizeOptions(options); | ||
|
||
const paths = fastGlob.sync('**/.gitignore', {cwd, ...gitignoreGlobOptions}); | ||
const paths = fastGlob.sync(pattern, {cwd, ...gitignoreGlobOptions}); |
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.
Maybe we should add dot: true
to the option, when pattern is *ignore
, not sure, need test.
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.
Maybe we should add dot: true to the option, when pattern is
*ignore
Sorry, I don't understand the suggestion.
need test.
Added.
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.
I mean, if user use {ignoreFiles: '*ignore'}
, can this glob files starts with .
? See https://github.com/mrmlnc/fast-glob#dot
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.
I personally don't find that necessary, and it makes the configuration a little complicated (what if the user didn't want to use dotfiles?). But I'll leave the decision to you.
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.
I'm not a maintainer :)
index.d.ts
Outdated
@@ -42,11 +42,20 @@ export interface Options extends FastGlobOptionsWithoutCwd { | |||
|
|||
/** | |||
Respect ignore patterns in `.gitignore` files that apply to the globbed files. | |||
This option takes precedence over the `ignoreFiles` option. |
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.
This don't have to "takes precedence", we can concat **/.gitignore
with ignoreFiles
, so they can use together.
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.
Done.
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.
The content in readme.md file didn't fix.
isGitIgnored, | ||
isGitIgnoredSync, | ||
} from './gitignore.js'; | ||
export {isIgnored, isIgnoredSync} from './ignore.js'; |
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.
I'm not sure if we want to expose these, if we do, maybe we need a better name, isIgnoredByIgnoreFiles
?
This has gotten another merge conflict. I'm not interested in doing more rounds. If you want to take this up, I release my changes as public domain. |
I can continue work on this. |
This is very similar to the
gitignore
option, except it allows globing for any compatible ignore file (eg,.prettierignore
or.eslintignore
). AMP had a recent need for this with ourprettier
integration, because it doesn't respect its ignore file when using the API directly.