astyle.sourceforge.net
net/projects/astyle/ Artistic Style is a source code indenter, source code formatter, and source code beautifier for the C, C++, C# and Java programming languages. When indenting source code, we as programmers have a tendency to use both spaces and tab characters to create the wanted indentation. Moreover, some editors by default insert spaces instead of tabs when pressing the tab key, and other editors (Emacs for example) have the ability to "pretty up" lines by automatically setting up the white space before the code on the line, possibly inserting spaces in a code that up to now used only tabs for indentation. Even if you as a programmer take care to ONLY use spaces or tabs, looking at other people's source code can still be problematic. To address this problem, Artistic Style was created - a filter written in C++ that automatically re-indents and re-formats C / C++ / C# / Java source files. It can be used from a command line, or it can be incorporated as classes in another C++ program.
The latest release is indicated by the line with a green background. Get the file for the appropriate platform (Linux or Windows). Most operating systems will decompress and display the package contents automatically. Follow the installation information for the appropriate platform.
It is best to log in to SourceForge before submitting a report so you can be contacted if necessary. Note that code copied and pasted into the bug report will not be indented after the data is submitted. You must indicate the indentation when you submit the request (eg replace leading spaces with periods).
With the second option, the file is saved with a different name. cpp"), can be used if the project is compiled to include them. See the above Installation Information for instructions. Options Not specifying any option will result in C/C++ style indentation, with a default of 4 spaces per indent, and NO formatting. Options may be written in two different ways: * Long options: These options start with '--', and must be written one at a time. If there is a conflict between a command line option and an option in the default options file, the command line option will be used. astylerc in the directory pointed to by the HOME environment variable (eg "$HOME/astylerc" on Linux); pre Predefined Style Options --style=ansi ANSI style formatting/indenting. Not specifying # will result in a default of 4 spaces per indent. Treat each tab as # spaces (eg -T6 / --force-indent=tab=6). Uses tabs as indents where --indent=tab prefers to use spaces, such as inside multi-line statements. default brackets option If no brackets option is set, the brackets will not be changed. Case statements not enclosed in blocks are NOT indented. Does a pretty good job, but can not perform miracles in obfuscated preprocessor definitions.
This indent makes helps to easily separate the header from the command statements that follow. The default setting for this option is twice the current indent (eg --min-conditional-indent=8).
This can be used with unpad=paren below to remove unwanted spaces. This can be used with unpad=paren below to remove unwanted spaces. Can be used in combination with the paren padding options pad=paren-out and pad=paren-in above. Only padding that has not been requested by other options will be removed. becomes (with no padding requested): if (isFoo(a, b)) bar(a, b); The option is set from the file extension for each file. It allows the formatter to identify language specific syntax such as C classes and C templates. The option is set from the file extension for each file. It allows the formatter to identify language specific syntax such as Java classes. This option should be helpful for systems/shells that do not have this option, such as in Windows95. Acknowledgements * Thanks to Jim Watson, Fred Shwartz, W Nathaniel Mills III, Danny Deschenes, Andre Houde, Richard Bullington, Paul-Michael Agapow, and Daryn Adler for their patches and contributions to Artistic Style;
|