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
Allow skipping symlink patterns, to avoid raising a fault #15533
Allow skipping symlink patterns, to avoid raising a fault #15533
Conversation
@fisker Can you approve to kick off CI? |
I think the behavior is expected, but maybe we can skip it if |
@fisker, Can you comment on the fact that the behavior does not match the docs and was different up to the breaking change? These are things I explained in my OP. |
@fisker This a reminder. My team is waiting for this. |
If I remember correctly, it only throws when the pattern is used as arguments. Say you have Correct me if I'm wrong. |
This was clarified in #14627 (comment). A tool that uses e.g., Git index changes to trigger Prettier cannot filter for symlinks in a cross-OS compatible manner. |
Put it behind |
What do you mean with ‘it’? Do you mean changing this PR to fix This invocation throws a fault - we have been using that parameter all along. This is also discussed in the PR, that you wanted me to open a new issue for.
|
NOT THROW IF |
@fisker Please allow me to ask a question for clarification. Is what you are meaning following? It is expected behavior that Prettier throws an error when you directly specify the symbolic link path. |
Yes, that's what I expect, what do you think? |
I'm 👍 on your opinion. |
@sosukesuzuki I implemented the requested change. Can you review please? |
@sanmai-NL @andersk Please take a look if you are fine with the changes. |
I'm fine with them too. |
Should @sosukesuzuki still review this? Hopefully users like in #15723 can be helped out soon. The PR is very small and @fisker made some fixes and improvements already. |
you are not going to patch every existing tool in the world into prettier lmao. |
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.
Sorry for delay my review, LGTM
…5533) Co-authored-by: fisker <lionkay@gmail.com>
Description
In #14627, Prettier was redesigned to ‘no longer follow symbolic links’. However, the implementation went further and turned into a breaking change. Rather than adhering to the exit status contract of only returning a non-zero exit status when a file is not formatted or when something is wrong with Prettier itself, #14627 made Prettier return a non-zero exit status upon any pattern turning out to be a pointing to symlink.
This PR fixes the original PR by @andersk to behave in line with its documentation.
Checklist
docs/
directory).changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨