feat: Add command to compare files by tree isomorphism #200
No reviewers
Labels
No labels
Compat/Breaking
Kind
Bad merge
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
New language
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: mergiraf/mergiraf#200
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "wetneb/mergiraf:197_mgf_dev_isomorphism"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This implements the simple version of tree isomorphism checking, without commutativity (#197).
There is still more code duplication than I'm happy with (for the text reading and parsing steps) but I couldn't figure out a way to refactor this given the ownership constraints. But surely one could try harder.
Here's what I came up with:
We use something very similar to
fn contents()
inmergiraf.rs
(read_file_to_string
+normalize_to_lf
) -- we might consider defining a function for that in the lib. While we're at it, we could useread_file_to_string
across the codebase -- currently we wrap every call tofs::read_to_string
with (very helpful!) error messages mentioning what file couldn't be read. We could put both methods innewline.rs
and rename the module toreadutils.rs
or something similar, since we use all the functions there to read and write files.Makes sense! I'm pushing your refactoring for now.
one more thing, after that we're good to go!
@ -24,12 +28,21 @@ enum Command {
/// Print the parsed tree for a file, for debugging purposes
could you please
#[deny(missing_docs)]
atCommand
while we're at it?ah nice, didn't know it existed.
And maybe extract the first 3 commits into a separate PR?
a2e7b0f2d2
toa80eb303fe