Login | Register
My pages Projects Community openCollabNet

Project home

2020-03-13: This site is going to be decommissioned and shut down very soon. Please copy and archive any data you wish to keep ASAP

If you were registered and logged in, you could join this project.

Summary Beautifier for bsh/C/C++/C#/D/groovy/java/javascript/nice/os/php
Category construction
License GNU General Public License
Owner(s) nijtmans

Message from the owner(s)

Busl 0.9 (Beta 2) released! See announcement.

BUSL: Beautifier for Universal Set of Languages. Version 0.9

  • Small but powerful
  • Handles at least actionscript/bsh/C/C++/C#/D/groovy/java/javascript/judoscript/nice/objectscript/php
  • Good integration with Version Control Systems and IDE's
  • Can handle scripts embedded in XML/HTML
  • Runs on any platform. Currently supported are DOS, WIN16, WIN32, Linux, any UNIX system
  • Result is beautiful on variable-width as well as fixed-width fonts.


The goal of BUSL is to build a simple but powerful beautifier which handles various modern compiled and interpreted languages. In stead of many configurable options, there are only a few options which form a good compromise between all supported languages. Therefore, a single coding-style can be used for all supported languages in stead of a separate coding-style for each language.

BUSL has a simple set of layout rules, which will not satisfy everyone. It is merely a compromise between the various coding-styles which are in use for the supported languages. BUSL doesn't enforce a maximum line length, it will only break lines when they contain too many brace levels.

BUSL is written in pure ISO C90 (ANSI C89) C, therefore it can be compiled on any platform which has a decent C-compiler. This even includes 16-bit platforms like DOS en Windows 3.1.

BUSL integrates well with any version control system. It only replaces files if the beautify process results in any change. If a file is locked, a new file will be created with the name <filename>$ and a warning is given. The user has the option to unlock the file and copy the created file, or just unlock the file and run BUSL again.

  • BUSL can handle code embedded in XML, such as javascript and PHP. It is not an XML beautifier: All XML is untouched, but all scripts in it are beautified. This makes BUSL a perfect companion to HTML TIDY which does the opposite: Beautifying XML but leave the scripts unmodified.
  • Integratable with VC++ (1.52, 5.x, 6.x), Visual Studio .NET and many other IDE's.

BUSL has the following ground rules, in order of priority

  • No loss of data: BUSL will never throw away the original file contents, unless you speficially ask for it (the "f" option). When running BUSL twice with the same options, the second run BUSL will do nothing.
  • No code corruption: BUSL will never modify the functionality of the code. Beautified sources will function as before.
  • Works well with any version control system, even if this system keeps files locked. If BUSL encounters a locked file, the beautified result will be stored in <filename>$ and a warning will be given. The user then can unlock the file and copy <filename>$ to <filename> or simply run BUSL again.
  • Any language which is similar in syntax to C, C++ and Java can be supported. It is more importantant that multiple languages are using the same style rules than to get the style rules optimized for each language separately.
  • BUSL concentrates on things humans are generally less capable of, such as converting tabs to spaces or removing/inserting spaces at specific harmless positions in the code.
  • BUSL by default uses tabs for line indenting, and spaces for all other layouting. This is the reason why the output will look good with any font, fixed-width as well as variable-width. Editors with configurable tab-width (e.g. Visual Studio, nedit) can vary the indent width on the fly. However, there is an option to use a configurable number of spaces for each indent level, in case you don't use such an editor and don't like the standard indent width.
  • We will try to use pure ISO C90 (ANSI C89) C as much as possible, so BUSL can be compiled on any platform. It should always compile without errors and warnings, no matter what compiler options are given. K&R style, however, is considered too old.

Related resources