Menu

#673 Repeatedly processing file results in additional (or reversal of) change

0.62
closed
None
CPP
1
2016-09-25
2016-05-10
Jay Visaria
No

Running uncrustify more than one time on some files results in additional changes.
In some cases (flipflopcppcmt.cpp - attached) the same change will be implemented or reversed every time the file is processed.

We would like to automate the use of uncrustify when files are checked into our configuration management system - but code review becomes problematic as uncrustify will reformat code that was untouched.

I have attached some example files that exhibit this behavior along with our uncrustify configuration file.

6 Attachments

Discussion

  • Guy Maurel

    Guy Maurel - 2016-05-17
    • assigned_to: Guy Maurel
     
  • Guy Maurel

    Guy Maurel - 2016-05-17

    Well!
    You can get a work-around for testb.h by changing the placement of the comment
    // Comments
    before the class statement.
    You can almost solve the problem with comment with
    align_right_cmt_span=1

    The case testa.cpp is still a problem. I am working on it.

     
  • Jay Visaria

    Jay Visaria - 2016-05-17

    Happy to see this getting some attention! We greatly appreciate it!
    Most of these can be solved on our end by scripting the formatter to run repeatedly until the file stabilizes... not ideal, but workable. The ones that change forever are less palatable.

    I'm attatching another example file which illustrates another, similar, issue in an instance where there are many extra parenthesis. Uncrustify will only remove one pair each time it is run on the file....

     
  • Guy Maurel

    Guy Maurel - 2016-09-25
    • status: open --> closed
     
  • Guy Maurel

    Guy Maurel - 2016-09-25