Skip to content
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

Merged
merged 4 commits into from Oct 14, 2020
Merged

Ignore Path flag #115

merged 4 commits into from Oct 14, 2020

Conversation

roggervalf
Copy link
Contributor

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.

@roggervalf
Copy link
Contributor Author

@azz, could you please review this new feature

Copy link
Member

@azz azz left a 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',
Copy link
Member

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.)

Suggested change
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)
Copy link
Member

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.

Suggested change
? createIgnorer(currentDirectory)
? createIgnorer(currentDirectory, ignorePath)

@azz
Copy link
Member

azz commented Oct 13, 2020

Definitely give me a @-mention to grab my attention because I'm drowning in notifications right now...

@roggervalf
Copy link
Contributor Author

roggervalf commented Oct 14, 2020

@azz I addressed your comments, could you please look at these new changes?

Copy link
Member

@azz azz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks 🙏

@azz azz merged commit eaf29e2 into prettier:master Oct 14, 2020
@azz
Copy link
Member

azz commented Oct 14, 2020

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants