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

feat: Tolerate string literals w/ ppath.join / ppath.resolve #5250

Merged
merged 6 commits into from
Feb 8, 2023

Conversation

arcanis
Copy link
Member

@arcanis arcanis commented Feb 7, 2023

What's the problem this PR addresses?

It's currently a little annoying to work with the fslib in tests, because all literal paths have to explicitly convert paths into PortablePath or Filename when passing them to ppath.join or ppath.resolve - even if they are literal strings, which are highly unlikely to be non-portable.

How did you fix it?

New generic overrides for ppath.join and ppath.resolve now tolerate string literals as arguments.

This is only true for those two methods; I didn't find a reasonable way to achieve it for all the FakeFS methods without all implementations having to copy / paste the signature.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis arcanis merged commit ca47575 into master Feb 8, 2023
@arcanis arcanis deleted the mael/path-join-filename branch February 8, 2023 07:25
@merceyz
Copy link
Member

merceyz commented Feb 8, 2023

Seems some more instances were missed, searching for ppath.(join|resolve).*as (Filename|PortablePath) shows a few that could be updated.

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.

3 participants