Announcement

Collapse
No announcement yet.

How to ignore line breaks (code formatting) on PHP files?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to ignore line breaks (code formatting) on PHP files?

    I need BC to ignore new line characters in PHP files.

    I have a few files that have been run through a code re-formatter in addition to being edited. All the differences in line breaks and spacing between the two versions of the PHP files makes the task of finding the actual, significant differences really hard. It just drowns in the noise of the inserted line breaks.

    It seems BC4 can ignore white space in terms of spaces and tabs, but it doesn't ignore line breaks using default settings.

    I downloaded the PHP grammar file from your web site. I have tried adding \n and \r (RegExp) as unimportant text in "Session Settings - Text Compare" > "Importance", but that doesn't help. I feel really stupid for not being able to figure out how to do such a simple thing. Any help would be greatly appreciated.

  • #2
    Hello,

    Our grammar Regular Expression definitions do not support joining or ignoring differences split over different lines. The Text Compare aligns line by line, then the grammars can define which sections are Important per line.

    The workaround for this is to run a pre-processor/clean-up to normalize the line break locations so they are in the same locations between the files. We have an example of this for RESX files in this KB article:
    http://www.scootersoftware.com/suppo...rnalconversion

    We have an HTML Tidy download, but not one specific for PHP, so you would need to find and define a conversion utility.
    Aaron P Scooter Software

    Comment


    • #3
      Need this for comparing patents/claims. Have this feature financed by a companay that has a patent management product? The first request to compare across line endings is at least 4 to 5 years old !

      Comment


      • #4
        Hello,

        Despite the age of the request, it's a very large project and difficult to tackle. While on our radar, it is not likely something we'll be able to tackle short-term. If you have any sample files you would like to add to our test cases so we have more tests to work with, you can email us at support@scootersoftware.com including a link back to this forum thread for our reference.
        Aaron P Scooter Software

        Comment

        Working...
        X