-
Notifications
You must be signed in to change notification settings - Fork 4
Refactored _read_first_bytes to _file_startswith for clarity of use
#287
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com>
Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor style for read_first_bytes function
Refactor Jan 23, 2026
_read_first_bytes to _file_startswith for clarity
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #287 +/- ##
==========================================
+ Coverage 84.12% 84.48% +0.35%
==========================================
Files 36 36
Lines 1392 1424 +32
==========================================
+ Hits 1171 1203 +32
Misses 221 221
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: CodyCBakerPhD <51133164+CodyCBakerPhD@users.noreply.github.com>
CodyCBakerPhD
approved these changes
Jan 23, 2026
_read_first_bytes to _file_startswith for clarity_read_first_bytes to _file_startswith for clarity
_read_first_bytes to _file_startswith for clarity_read_first_bytes to _file_startswith for clarity of use
CodyCBakerPhD
approved these changes
Jan 23, 2026
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
_read_first_bytes_read_first_byteswith_file_startswithhelper function_content_is_retrievedto use the new function_read_first_bytesfunctionstostringper review feedbackSummary
Successfully refactored
_read_first_bytesto_file_startswithas requested in issue #166.Changes:
_read_first_bytes(file_path, n=6)with_file_startswith(file_path, string)6(which waslen("/annex"))_read_first_bytes(file_path=file_path, n=6) != b"/annex"→not _file_startswith(file_path=file_path, string="/annex")Testing:
✅ All custom tests pass (basic and real-world scenarios)
✅ Existing unit tests pass
✅ Linting passes (ruff)
✅ Type checking passes (mypy)
✅ No security issues (CodeQL)
Security Summary:
No security vulnerabilities detected in the changes.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.