-
Notifications
You must be signed in to change notification settings - Fork 1k
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 multiple spaces in PRISMA_DIRECT_URL_REGEXP #8001
Conversation
Allows multiple spaces between directUrl = env, since some code formatters add these to schema.prisma.
@dennemark the regex change looks fine. It just seems strange to me there could be multiple whitespaces. re: "since some code formatters add these to schema.prisma." Can you paste an example and give a bit more background? @dthyresson Could I loop you in on this one? I'm likely being too cautious on this one. Just didn't want to open things up too wide and someone end up with an edge case bug. |
|
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.
@dennemark Thanks for this improvement. As I understand it, the regex needs to handle the case where you've added a directUrl and Prisma prettify-ing has added spaces to align the content. And thus, formatter with the spaces, the regex won't match.
Makes sense.
Could we add this scenario to the tests so there is a test for:
- no directUrl
- formatted, unaligned
- formatted, aligned with spaces
That way we cover the cases and won't have a regressions.
Thanks!
I have added the formatted test, the other ones are already existing. They take their schema from fixtures. Those fixtures are actually also formatted, but they got along with one space test, since they did not include the shadowDatabaseUrl. I added a test case where I did not import from fixtures, but provide a multi-line string. Works out. |
is it possible to merge? :) |
Allows multiple spaces between directUrl = env, since some code formatters add these to schema.prisma.