Artistic Style 1.22

A Free, Fast and Small Automatic Formatter
for C, C++, C#, and Java Source Code


Home Page: http://astyle.sourceforge.net/
Project Page: http://sourceforge.net/projects/astyle/

 

Artistic Style is a source code indenter, formatter, and 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.

Since the NUMBER of space characters showed on screen for each tab character in the source code changes between editors (unless the user sets up the number to his liking...), one of the standard problems programmers are facing when moving from one editor to another is that code containing both spaces and tabs that was up to now perfectly indented, suddenly becomes a mess to look at when changing to another editor. 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.

Documentation

There is complete documentation for using Artistic Style. Most documentation is included in the distribution package.

News and Release Notes

Changes in this release include improved file handling, recursive processing, a Java Native Interface, a new backup script, and many important bug fixes. Developers using Artistic Style in another project should be aware that there are two new functions that have been added to the ASStreamIterator class.

Download

Download the latest release from the file releases page. Get the file for the appropriate platform (Linux, Mac, OpenVMS, or Windows). Extract the compressed package and copy it to a work folder. Then follow the install instructions for the appropriate platform as described in the Install Information.

Install Information

Information on compiling and installing Artistic Style. The Windows and OpenVMS platforms come with a precompiled executable. Other platforms must compile the project. Follow the instructions for the appropriate platform (Linux, Mac, OpenVMS, or Windows).

License

Artistic Style may be used and distributed under the GNU Lesser General Public License (LGPL), version 2.1. You can use it in free or commercial software without charge. Projects that use Artistic Style do not have to make the source code available. If Artistic Style itself is modified, however, the modified Artistic Style source code must be made available.

Scripts

astyle-clean.sh is a Linux shell script to clean a directory tree by moving Artistic Style backup files to a separate directory. This allows Artistic Style to create backup files without cluttering your source directories. There are four variables at the start of the script that need to be set for each application. The script will move or copy backup files to a backup directory maintaining the original directory structure. New backup files will be copied over the old so you will always have the most current backup.

astyle-clean.bat is a Windows batch file to clean a directory tree by moving Artistic Style backup files to a separate directory. This allows Artistic Style to create backup files without cluttering your source directories. There are four variables at the start of the script that need to be set for each application. The script will move or copy backup files to a backup directory maintaining the original directory structure. New backup files will be copied over the old so you will always have the most current backup.

astyle.pl is a Mac Perl script to reindent source files in TextWrangler and BBEdit using Artistic Style. Selected text from the editor can be passed to Artistic Style and replaced with the reformatted text. Save the script in the "Unix Filters" directory (you need to restart TextWrangler to see new scripts). Then simply highlight the text you would like to reindent, choose the script from the Shebang (#!) menu, and the text will be immaculately formatted. You can add Artistic Style options to the "my $astyle" line in the script.

Links

There are several applications that use Artistic Style as contributed software. It is either embedded in the application or called as a command line program.

Supplemental Documentation

There are some formatting problems with --break‑blocks (or --break‑blocks=all).

Developer Information

Artistic Style has compile options for creating a shared library (DLL) or static library for use with a Graphical User Interface (GUI). With the Java Development Kit (JDK) installed it can be compiled as a Java Native Interface (JNI) and called from a Java program. The Developer Information documents the calling procedure and has example programs.

Bug Reports, Change Requests, Notification

Bug reports and change requests should be submitted to the bug tracker page. 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 (e.g. replace leading spaces with periods).

Notification of new releases is activated from the file releases page. In the Latest File Releases section at the top of the page, Notes/Monitor column, click on the envelope. You will receive notification when a new release is available.

To contact the project by email use the address jimp03@email.com.

Maintainers 

Artistic Style is maintained and updated by Jim Pattee. The original author was Tal Davidson, Israel.

Acknowledgments

Thanks to Jim Watson, Fred Shwartz, W. Nathaniel Mills III, Danny Deschenes, Andre Houde, Richard Bullington, Paul-Michael Agapow, Daryn Adler, Dieter Bayer, Sam Cooler, Jim Duff, Emilio Guijarro, Jens Krinke, for their patches and contributions to Artistic Style.

Thanks to SourceForge for giving Artistic Style its home.

Thanks to all the dedicated beta-testers and bug notifiers!

ENJOY !!!