-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Ignore Path flag #115
Ignore Path flag #115
Conversation
@azz, could you please review this new feature |
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.
Hey @roggervalf, thanks for the PR!
Would you be able to add a test for this?
src/index.js
Outdated
@@ -15,6 +15,7 @@ export default ( | |||
branch, | |||
bail, | |||
check, | |||
ignorePath = '.prettierignore', |
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.
Should still work if you just do this? (As the undefined
value will get overwritten inside createIgnorer
.)
ignorePath = '.prettierignore', | |
ignorePath, |
src/index.js
Outdated
@@ -35,7 +36,7 @@ export default ( | |||
|
|||
onFoundSinceRevision && onFoundSinceRevision(scm.name, revision); | |||
|
|||
const rootIgnorer = createIgnorer(directory); | |||
const rootIgnorer = createIgnorer(directory, ignorePath); | |||
const cwdIgnorer = | |||
currentDirectory !== directory | |||
? createIgnorer(currentDirectory) |
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.
May as well pass in ignorePath
here too, in case someone is running prettier not in the git root directory and has ignorePath
set relative to a subdirectory.
? createIgnorer(currentDirectory) | |
? createIgnorer(currentDirectory, ignorePath) |
Definitely give me a @-mention to grab my attention because I'm drowning in notifications right now... |
@azz I addressed your comments, could you please look at these new changes? |
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.
Perfect, thanks 🙏
🎉 This PR is included in version 3.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adding new flag to define a custom path for ignore files since prettier also could define a custom path to defines those patters to skip.