-
Notifications
You must be signed in to change notification settings - Fork 643
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(files): allow decoding project files directly to string #2396
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2396 +/- ##
==========================================
- Coverage 95.97% 95.92% -0.05%
==========================================
Files 80 80
Lines 5342 5354 +12
==========================================
+ Hits 5127 5136 +9
- Misses 215 218 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hi! Sorry if I am oversharing here, especially as I don't know this project and its conventions well (yet!). While this is definitely an improvement from the previous syntax I feel that this could and maybe should be even simpler. Because people mostly store source code in git then the most popular use-case here will probably be getting the content of the file as So I propose to add a method For bytes I would personally prefer having For completeness I would add PS I've never used |
@gdubicki thanks for the feedback! I'll take another look at what wording makes the most sense, especially when compared to For context, this In most other cases we do not add more higher-level convenience and instead keep it a thin wrapper, so I'd be wary of introducing more methods but if we do already provide some decoding then it probably makes sense to make it actually convenient for the user ;) I agree Edit: the |
Maybe an additional |
Provides a slightly less clunky interface so people don't need to do
f.decode.().decode("utf-8")
in user code.