#184 [PATCH] dry-run support

closed-fixed
Patches (3)
7
2015-01-03
2012-09-25
No

This is similar to rsync's --dry-run option, in that it runs through everything to show you what it WOULD do, but doesn't actually make any changes to the filesystem.

From the astyle -h:
--dry-run
Perform a trial run with no changes made (useful for checking if formatted).

Reason for patch:
I am using astyle to automatically format code on a mercurial commit hook, but in the main repository I also want to deny pushes that contain code not formatted by astyle, with the --dry-run option I can simply grep the output of astyle for '^Formatted" to see if things any files haven't been formatted according to our astyle configuration. This allows astyle to work somewhat like checkstyle.

Hopefully this can be accepted into the main branch fairly soon, as it's helpful and a pretty trivial change. If you have any problems with it or want anything else changed let me know.

Discussion

  • moparisthebest

    moparisthebest - 2012-09-25

    dry-run.patch

     
  • Isak Styf

    Isak Styf - 2014-05-14

    +1 for this one. We were just about to setup a git commit hook where we wanted to run astyle in a dry run mode and I was very suprised to see that it wasn't already supported. I had to create a new patch since the one from moparisthebest refuses to apply to 2.04.

     
  • moparisthebest

    moparisthebest - 2014-05-19

    Thanks for updating this Isak, to tell the truth, it'd been so long that I forgot about this patch all together. :) I'd still like to see this get merged though for the same reasons as Isak though.

     
  • Robert Dailey

    Robert Dailey - 2014-06-18

    Definitely need this. I want to put in a server-side git pre-receive hook to deny code that does not follow our formatting guidelines.

     
  • Robert Dailey

    Robert Dailey - 2014-06-18

    I've updated the patch based on latest code in SVN as of today (see dry-run2.patch attached). Should help make the patch easier to apply.

     
    Last edit: Robert Dailey 2014-06-18
  • Jim Pattee

    Jim Pattee - 2014-09-14

    Added option in SVN.

     
  • Jim Pattee

    Jim Pattee - 2014-09-14
    • status: open --> open-fixed
    • assigned_to: Jim Pattee
    • Priority: 5 --> 7
     
  • Jim Pattee

    Jim Pattee - 2014-11-20
    • Status: open-fixed --> closed-fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks