AOEpeople / mpmd

Magento Project Mess Detector (for n98-magerun)
181 stars 26 forks source link

Create different changetype for whitespace diffs #7

Closed navarr closed 8 years ago

navarr commented 9 years ago

This removes spam from whitespace changes between the fresh copy and the existing copy.

Example:

So much nicer than having 13724 "diferentFileContent" with blank diffs.

steverobbins commented 9 years ago

:+1:

beejhuff commented 9 years ago

Navarr, I'm a bit new to this utility but have recently came across this same issue you're addressing. Thanks for submitting this!

Am I correct that the core of your update here is that you're taking the output of file_get_contents and then replacing whitepsaces, tabs, new lines and carriage returns in that output so that they are normalized before passed to the subsequent shellexec call to diff in getFileDiff() ?

navarr commented 9 years ago

This actually isn't touched by getFileDiff. For the part of the program that determines whether or not the files have any differences a simple string comparison is done.

Instead of normalizing I completely remove all whitespace. Which could theoretically not show certain diffs in strings that are whitespace related.

On Fri, Jun 5, 2015, 12:42 Bryan Hoffpauir (BJ Hoffpauir) - Chief Technology Officer notifications@github.com wrote:

Navarr, I'm a bit new to this utility but have recently came across this same issue you're addressing. Thanks for submitting this!

Am I correct that the core of your update here is that you're taking the output of file_get_contents and then replacing whitepsaces, tabs, new lines and carriage returns in that output so that they are normalized before passed to the subsequent shellexec call to diff in getFileDiff() ?

— Reply to this email directly or view it on GitHub https://github.com/AOEpeople/mpmd/pull/7#issuecomment-109358263.

navarr commented 9 years ago

@fbrnc I've updated the PR with the better whitespace normalization we discussed (and fixed a bug I accidentally introduced when I tried to pretty up the commit history for this PR - whoops!)

navarr commented 8 years ago

@fbrnc Anything else missing from this? It's been a few months :stuck_out_tongue:

fbrnc commented 8 years ago

Sorry for the delay. Just merged your code. Thank you!