This is a list of TODO items:

Most important features (in order):
----------------------------------------------------------------------------

 - Indenting lines correctly
   + continuing on parens, assignment ops, and strings

 - Add/remove spaces around operators

 - aligning
   + struct/union definitions
       struct foo_t {
          const char *name;
	  uint32_t   age;
       };

   + static struct variable definitions
       struct foo_t bar = {
          .name = "bar",
	  .age  = 21
       };
       struct foo_t bars[] = {
          [0] = { .name = "bar",
	          .age  = 21 },
          [1] = { .name = "barley",
	          .age  = 55 },
       };

   + enum definition
       enum fruits {
          apple     = 1,
	  orange    = 2,
	  pineapple = 4,
       };

   + variable definitions
      int           a;
      unsigned char b;

   + assignments
      a.latitude  = 1;
      a.longitude = 2;
      a.altitude  = 3;

   + trailing comments
      int a;  // this is a variable that has
              // a multi-line C++ comment

 - adding and removing parens around return expressions (safe code change)
   + add in all cases
   + remove in all cases
   + remove for simple cases

 - adding braces to do the fully braced format (dangerous code change)

 - removing braces to do the un-braced format (dangerous code change)


Here's the stuff that needs doing that I consider important:
----------------------------------------------------------------------------

2. Preprocessor crap

 * indent levels for if/else/endif preprocessors

 * Ignore #define body by default (??)

 * add option to space and/or line break, etc #define bodies

 * indent preprocessor bodies (done, I think?)

3. General aligning

   - thresholds!  I hate seeing silly alignments:

   This:
{
   char c                = 0;
   int  really_long_name = 1;
}

   Should be this, assuming a sane align threshold, like 3 or so.
{
   char c = 0;
   int  really_long_name = 1;
}


4. Splitting lines

   - Figure out some sort of sane approach (ie, look at the indent source)

   - Not sure I want to go there...


For when I really get bored:
----------------------------------------------------------------------------

 - Look into trying out D support.  Shouldn't be too hard.
 - maybe also add some sort of Java support



For when I get bored of all my games and have a really long vacation:
----------------------------------------------------------------------------

 - Look into C++ support
   + templates scare me
     - need to figure out how to (reliably) tell the difference between
       a template variable and a useless comparison

   + may be impossible to do right without some type-awareness



============================================================================
============================================================================

Configuration files

============================================================================
============================================================================

Create working config files for these categories:

 - K&R (started)
 - GNU (started)
 - Linux kernel (started)
 - Ben's favorite (used in uncrustify) - work in progress
 - xsupplicant (weird almost-GNU style) - done (unless I find a bug...)

That should be enough examples.

I plan to add any style that people want.
I mean, throwing in another config file won't hurt anything...

Add some smarts to uncrustify so that it scans for config files as follows:
 - check in the current folder (exact name only)
 - check in ~/.uncrustify
 - check in /etc/uncrustify

If the -c option doesn't end in a '.cfg' it'll try first without and then with the .cfg
If the config contains a path component, then only check that path.


Todo List
=========

1. Output files
Add option to output to a filename instead of stdout.
Possibly "-o" for output filename or "-r" to replace file.
Output first to a temporary file filename.unc~ and then rename when successful?

Difficulty: Low
Estimated:  2 hours


2. Finish off D support
Involves running against large quantities of D code and working out all the bugs.
May need to add more options to support unique formatting.

 - volatile needs special handling
 - delegate handling

Difficulty: Moderate
Estimated:  8 hours


3. Finish off Java support
Involves running against large quantities of Java code and working out all the bugs.
May need to add more options to support unique formatting.

Difficulty: Moderate
Estimated:  8 hours


4. Add thresholds for aligning
Need to figure out a reasonable approach and implement.
Will need to add options such as: UO_align_assign_threshold

Difficulty: Moderate
Estimated:  4 hours


5. Add detection of aligned items in input files
This is needed to preserve already aligned stuff without aligning more than is
needed.  Ie, this is needed to minimize changes, while cleaning up existing
code.
We can assume that code can be aligned that has either a tab of more than 1
space before it was intended to be aligned.  Maybe add a threshold, like 3
columns.

Difficulty: Moderate
Estimated:  8 hours


6. Possibly split out tokenizing and initial labeling
May not be any reason to do this, since all languages are C-like.

Difficulty: High
Estimated:  12 hours


7. Fix #ifdef indenting for ifdef-nest.c (line 19 not indented correctly)
Note sure why this isn't working right.

Difficulty: Moderate
Estimated:  4 hours


8. Add a threshold for brace adding
Should be fairly easy. Already have code for removal.

Difficulty: Low
Estimated:  2 hours

