> Related to FLTK 3: since I have touched EVERY file of FLTK3 anyways, > there is no need to keep history of a file or do a diff at some point. > That would be a nice occasion to run some app that will re-indent the > files. > > Any suggestions for a tool? Preferably on OS X? Maybe someone even > has the correct settings for FLTK's coding style?
A quick search of the web throws up the following [there may be more]: http://astyle.sourceforge.net/ http://www.gnu.org/software/indent/ http://uncrustify.sourceforge.net/ http://universalindent.sourceforge.net/ The last one is a Qt/scintilla application that allows you to set options for a whole series of formatters, including the three given, and see a live preview of the change. Unfortunately it's not clear to me whether it reformats from the original state every time, or it is cumulative. [And selecting astyle gives an error unless your file is called indentinput.cxx and you fix the --style=k/r in the config] Calling 'indent -kr' and 'astyle --style=k/r" give similar results, but long line length is different: uncrustify doesn't have a quick style option, so will need more experimentation. For "if (x) y;", "for (x) y;" and "while(x) y;" indent will always reformat as two lines. astyle can be configured to leave one-liners. indent always reformats pointer decls to "char *s;" whereas there's astyle can give "char* s;". Don't know about "char *s, *t;". The big question is: do we spend time and effort to experiment with configurations/options to match the existing FLTK coding guidelines, or do we simply take a standard style from one of these tools, with minor adjustments? e.g. indent -kr -i2 -l100 -ncs -nfca -nut [more?] Cheers D. _______________________________________________ fltk-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
