Skip to content
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

The diffs don't provide much value #21

Open
Bios-Marcel opened this issue Sep 25, 2023 · 3 comments
Open

The diffs don't provide much value #21

Bios-Marcel opened this issue Sep 25, 2023 · 3 comments

Comments

@Bios-Marcel
Copy link
Contributor

The diffs currently don't provide a lot of value, since a single line changed is displayed as a many-line diff. I am not sure if this is an issue on my machine or simply how the feature was implemented.

WindowsTerminal_lQU2TzFYid
@gtramontina
Copy link
Owner

gtramontina commented Sep 30, 2023

I attempted to address this here https://github.com/gtramontina/ooze#prerequisites (second paragraph).

Not sure if this is what you’re experiencing, though.

Open to alternative implementations! 😅

Edit: permalink:

ooze/readme.md

Line 38 in 1255479

When Ooze reports that it found a living mutant, it will print a diff of the changes the virus made to the source file. The mutant source is printed using Go's [`go/format`](https://pkg.go.dev/go/format) package. This means that, if your source code isn't gofmt'd, the diff may contain some formatting changes that are not relevant to the mutation. This isn't a prerequisite per se, but for a better experience, it is recommended that you run `gofmt` on your source files.

@Bios-Marcel
Copy link
Contributor Author

Yes, this seems to solve it. Weird bug though :D I guess we could gofmt both before comparing as a workaround?

@gtramontina
Copy link
Owner

Sorry about the delay… I guess running gofmt on the source "on the fly" before comparing can potentially yeild diffs that point to the wrong line/place, generating confusion… 🤔 Hence the recommendation on the readme. I do agree that the opposite can be confusing as well. Perhaps adding a note at the end of the summary mentioning it could help? Something like: If your diffs look weird, consider running gofmt before the mutation tests.

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

No branches or pull requests

2 participants