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

Use posix path style for relative imports #721

Merged
merged 2 commits into from
Dec 6, 2023
Merged

Use posix path style for relative imports #721

merged 2 commits into from
Dec 6, 2023

Conversation

Sese-Schneider
Copy link
Contributor

@Sese-Schneider Sese-Schneider commented Nov 21, 2023

Details

Fixes #711

Generated relative imports paths on windows used backslashes instead of forwards slashes.
This broke the DartFormatter and the build_runner aborted.

Fix

I specifically added p.Context(style: p.Style.posix) to the .relative part of the path generation.
This ensures the import paths contain only forward slashes.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
Contribution guidelines:

Note that many Dart repos have a weekly cadence for reviewing PRs - please allow for some latency before initial review feedback.

@Sese-Schneider Sese-Schneider changed the title Use posix path style for local imports Use posix path style for relative imports Nov 21, 2023
@Sese-Schneider
Copy link
Contributor Author

Interesting sidenote:
I don't know why this broke for me suddenly. We've been using mockito for over 2 years now and everything used to work fine.
Furthermore we haven't updated the dart version in our codebase in the last few months. The issue seem to have appeared out of nowhere 🤷🏼‍♂️

lib/src/builder.dart Outdated Show resolved Hide resolved
@copybara-service copybara-service bot merged commit 57a7c82 into dart-lang:master Dec 6, 2023
8 checks passed
mosuem pushed a commit to dart-lang/test that referenced this pull request Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated Imports use Unescaped backslashes
2 participants