Skip to content

add colorized diff back#11

Merged
ahl merged 1 commit into
masterfrom
content-fixes
Apr 13, 2022
Merged

add colorized diff back#11
ahl merged 1 commit into
masterfrom
content-fixes

Conversation

@ahl

@ahl ahl commented Apr 12, 2022

Copy link
Copy Markdown
Collaborator
$ cargo run  --example basic
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/examples/basic`
@@ -1,5 +1,2 @@
-No one hits like Gaston
-Matches wits like Gaston
-In a spitting match nobody spits like Gaston
+In a testing match nobody tests like Gaston
 I'm especially good at expectorating
-Ten points for Gaston

thread 'main' panicked at 'assertion failed: string doesn't match the contents of file: "examples/lyrics.txt" see diffset above
                set EXPECTORATE=overwrite if these changes are intentional', examples/basic.rs:7:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@ahl ahl requested a review from david-crespo April 12, 2022 16:07

@david-crespo david-crespo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome.

Semi-related nitpick, I was going to suggest updating this bit of the readme to take the filename header off because that's not what our output is. Then I saw that it's not meant to show our output but rather git diff. I think this is confusing, since I was in fact confused by it. It's a diff library and you would expect to see sample output in the readme, so I suggest taking out the git diff bit if you're amenable. It made more sense when our output was more different from git's. Now they're almost the same, so it's like "what is this telling me?"

expectorate/README.md

Lines 20 to 35 in e1666ca

If we want to accept the changes from `compose()` we'd simply run with `EXPECTORATE=overwrite`. Assuming `lyrics.txt` is checked in, `git diff` will show you something like this:
```diff
diff --git a/examples/lyrics.txt b/examples/lyrics.txt
index e4104c1..ea6beaf 100644
--- a/examples/lyrics.txt
+++ b/examples/lyrics.txt
@@ -1,5 +1,2 @@
-No one hits like Gaston
-Matches wits like Gaston
-In a spitting match nobody spits like Gaston
+In a testing match nobody tests like Gaston
I'm especially good at expectorating
-Ten points for Gaston
```

@ahl

ahl commented Apr 13, 2022

Copy link
Copy Markdown
Collaborator Author

Noted; I think that the README is useful in terms of explaining the expected use.

@ahl ahl merged commit cdc0928 into master Apr 13, 2022
@ahl ahl deleted the content-fixes branch April 13, 2022 04:15
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.

2 participants