Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #448 +/- ##
==========================================
+ Coverage 91.18% 91.96% +0.77%
==========================================
Files 11 11
Lines 715 722 +7
==========================================
+ Hits 652 664 +12
+ Misses 63 58 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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
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.
The point of this PR is to solve #440.
In particular, it shows that the current implementation shadows (and breaks) any implementation that is not in the registry table of format/extensions/packages, if one implementation is already registered.
Main point of debate IMHO
Current situation
The main problem with the current implementation is that if somebody registers some format, the current implementation is breaking for any unregistered implementation.
This is exactly what happened in #440. I had a working implementation, and because @maucejo added his package to the registry table, that led to my own package failing its tests with newer versions of
FileIO.jl.Current solution
It is possible to use
save(format"<FORMAT>", <path>, <data>)to avoid the issue, but that implies thatFileIO.jlforces users with custom implementations to revise their codebase if the registry table is updated, something that feels somewhat brittle, especially given that the semantic versioning of registry table modifications is minor revision stage.In addition, it sort of means that the registered package is "more important" that the unregistered one(s), since
FileIO.jlerrors if you don't load the official package, even if you have declared a proper implementation.Proposal
While the initial implementation forces to use the first available format matching some extension, I propose to use the last one.
I know it defeats the loading order problem in Principle-of-operation:-module-qualification, but my opinion is that problem is already there, just reverted, between the official registry table and the custom implementation.
The logic behind choosing the last available implementation is the following
:UNKNOWNi.e. the only way to make a selection is the extensionComments