Tree [5987f2] master uncrustify-0.62 /
 History



File Date Author Commit
 documentation 6 days ago Ben Gardner Ben Gardner [b08b81] Update version, config files, run update-defaul...
 etc 6 days ago Ben Gardner Ben Gardner [b08b81] Update version, config files, run update-defaul...
 man 2014-10-14 Ben Gardner Ben Gardner [204624] Update the year in the man page
 osx 2009-10-19 André Berg André Berg [441fa5] Add missing osx directory.
 scripts 2012-02-25 Mirko König Mirko König [5542d0] Added a script that generates uncrustify_versio...
 src 2016-02-01 bengardner bengardner [a8f477] PAWN: Cannot modify the #define PATTERN at all
 tests 2016-02-01 bengardner bengardner [a8f477] PAWN: Cannot modify the #define PATTERN at all
 uncrustify.xcodeproj 2014-12-19 logan.gauthier@metova.com logan.gauthier@metova.com [5814e8] Added fix for issue #124: https://github.com/be...
 win32 2015-02-19 Ben Gardner Ben Gardner [3ea72e] Run uncrustify on itself using etc/ben.cfg, wit...
 .gitignore 2012-04-26 Jan Weiß Jan Weiß [2bff45] Updating “.gitignore” for Xcode 4.
 AUTHORS 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 BUGS 2014-10-14 Ben Gardner Ben Gardner [531332] Update BUGS a bit
 COPYING 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 ChangeLog 6 days ago Ben Gardner Ben Gardner [5987f2] Update ChangeLog and commit.log
 HELP 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 INSTALL 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 Makefile.am 2010-05-28 Ben Gardner Ben Gardner [d2c438] Use silent rules instead of nostdinc
 Makefile.in 6 days ago Ben Gardner Ben Gardner [b08b81] Update version, config files, run update-defaul...
 NEWS 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 README.md 2015-08-10 Siddharth Kannan Siddharth Kannan [c2c2ac] Add file links to the readme
 TESTING 2011-08-26 Pat Notz Pat Notz [a0f6fb] Tweaks to the TESTING how-to
 aclocal.m4 6 days ago Ben Gardner Ben Gardner [b08b81] Update version, config files, run update-defaul...
 autogen.sh 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 commit.log 6 days ago Ben Gardner Ben Gardner [5987f2] Update ChangeLog and commit.log
 compile 2014-08-22 Ben Gardner Ben Gardner [e8e4c2] Re-run autogen.sh on Ubuntu 14.04
 config.guess 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 config.sub 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 configure 6 days ago Ben Gardner Ben Gardner [b08b81] Update version, config files, run update-defaul...
 configure.ac 6 days ago Ben Gardner Ben Gardner [b08b81] Update version, config files, run update-defaul...
 extras.vpj 2013-01-01 Ben Gardner Ben Gardner [5d1398] Add a few files to the workspace
 install-sh 2014-08-22 Ben Gardner Ben Gardner [e8e4c2] Re-run autogen.sh on Ubuntu 14.04
 make_token_names.sh 2012-12-28 Ben Gardner Ben Gardner [ec14de] Remove the date from token_names.h/make_token_n...
 make_version.py 2014-08-22 Ben Gardner Ben Gardner [a6ac4f] make_version.py: no need to split lines of uncr...
 make_win32.sh 6 days ago Ben Gardner Ben Gardner [6aeb46] Rework make_win32.sh to build outside of the so...
 missing 2014-08-22 Ben Gardner Ben Gardner [e8e4c2] Re-run autogen.sh on Ubuntu 14.04
 package.json 2015-02-18 Shazron Abdullah Shazron Abdullah [6155fa] Added package.json for npm
 release-steps.txt 2016-02-02 Ben Gardner Ben Gardner [34a104] Update release steps
 run_tests.sh 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 test-driver 2014-08-22 Ben Gardner Ben Gardner [e8e4c2] Re-run autogen.sh on Ubuntu 14.04
 uncrustify.vpj 2011-12-29 Ben Gardner Ben Gardner [044ebe] Add ability to get config from UNCRUSTIFY_CONFI...
 uncrustify.vpw 2011-10-09 Ben Gardner Ben Gardner [c40457] Update SlickEdit project files
 update-default-cfg.sh 2009-10-17 Ben Gardner Ben Gardner [fe25b6] Import r1644 from subversion
 working.txt 2009-12-05 Ben Gardner Ben Gardner [837f57] save off work in the freebsd branch

Read Me

README for Uncrustify

Post any bugs to the issue tracker found on the project's Sourceforge page:
http://sourceforge.net/projects/uncrustify

Please include the following with your issue:
- a description of what is not working right
- input code sufficient to demonstrate the issue
- expected output code
- configuration options used to generate the output

If the issue cannot be easily reproduced, then it isn't likely to be fixed.

Building the program

Quick start:

$ ./configure
$ make

The executable is src/uncrustify.
Copy that to your ~/bin/ folder or wherever you want.

Building the program using Xcode on Mac OS X

You can of course just open the Xcode project and build uncrustify using the
default 'Debug' configuration but if you want to install it the 'Install'
configuration will not work from within Xcode.

For that you will have to use the Xcode command line tool 'xcodebuild'.

To do that, cd into the uncrustify project folder where uncrustify.xcodeproj
resides and enter the following command:

$ sudo xcodebuild -configuration 'Install'

You will be prompted for the root level password. By doing this you will install
uncrustify into /usr/local/bin. The install location can be changed by editing
the Build Settings for the uncrustify target. The setting you need to change is
called, surprisingly enough, 'Installation Directory'.

Configuring the program

Examine the example config files in etc (such as ben.cfg)
and/or read configuration.txt.
Copy the existing config file that closely matches your style and put in
~/.uncrustify/. Find complete configuration file options
in this file. Modify to your
liking.

Running the program (and refining your style)

As of the current release, I don't particularly trust this program to not make
mistakes and screw up my whitespace formatting.

Here's how to run it:

$ uncrustify -c ~/.uncrustify/mystyle.cfg -f somefile.c > somefile.c.unc

The -c option selects the configuration file.
The -f option specifies the input file.
The output is sent to stdout. Error messages are sent to stderr.

Use a quality side-by-side diff tool to determine if the program did what you
wanted.
Repeat until your style is refined.

Running the program (once you've found your style)

Write a script to automate the above.
Check out etc/dofiles.sh for an example.
That script is used as follows:

  1. navigate one level above your project
  2. make a list of file to process
    $ find myproj -name "*.[ch]" > files.txt
  3. $ sh etc/dofiles.sh files.txt
  4. Use your favorite diff/merge program to merge in the changes
    $ xxdiff out/myproj myproj