1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
README for Uncrustify
=====================
Building the program
--------------------
Quick start:
$ ./configure
$ make
The executable is src/uncrustify.
Copy that to your ~/bin/ folder or wherever you want.
Configuring the program
-----------------------
Examine the example config files in etc and/or read
documentation/htdocs/configuration.txt.
Copy the existing config file that closely matches your style and put in
~/.uncrustify/. 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
|