Artistic Style Changelog

What's new in Artistic Style 2.03

Apr 15, 2013
  • Add new option "indent=force-tab-x=#" (-xT#) to allow a tab length that different from the indent length (3430662).
  • Add new option, "pad-first-paren-out" (xd), to pad only the first paren in a series on the outside (3350356).
  • Add new option "max-code-length=#" (-xC#) to limit the length of code on a line.
  • Add new option "break-after-logical" (-xL) to modify a "max-code-length" line break for conditionals.
  • Add new option "close-templates" (-xy) to close whitespace in the angle brackets ">" of template definitions.
  • Add formatting of C++ rvalue references (&&) using the existing "align-pointer" and "align-reference" options.
  • Add formatting of C++/CLI managed pointers (the "^" character) to the "align-pointer" option.
  • Add translations for Dutch, Finnish, Italian, Japanese, Korean, Polish, Portuguese, Russian, Swedish, and Ukrainian.
  • Remove byte-order-mark from ASLocalizer.cpp.
  • Change the short option for delete-empty-lines from "xd" to "xe".
  • Change the ASTYLE_LIB option to remove __declspec for a Visual C static library when ASTYLE_NO_VCX is also declared.
  • Change to remove any space padding in a pointer to pointer (**).
  • Fix "break-elseifs" to format one-line "if" and "else" statements the same as when the option is not used.
  • Fix "break-elseifs" to break else-if statements when "keep-one-line-statements" also is requested.
  • Fix "break-elseifs" to correctly format comments preceding the else-if.
  • Fix C# not correctly identifying lambda expressions as a command-type bracket.
  • Fix C# preprocessor statements adding extra empty lines when "break-blocks" is used.
  • Fix C# padding "get" and "set" statements that are not headers when "break-blocks" is used.
  • Fix C# to recognize the "#line" statement.
  • Fix C++11 standard for range-based "for" loops (3458402, 3480095).
  • Fix C++11 standard for "enum" with a base type (3458402).
  • Fix C++11 standard for template closing angle brackets (no space required) (3495192).
  • Fix C/C++ keyword 'extern "C"' in a preprocessor causing an extra indent (1514844, 2953388, 2963382, 3093842, 3467479).
  • Fix breaking after a switch "default" statement when "break-elseifs" is used without "keep-one-line-statements" (3559365).
  • Fix in-statement arrays to indent correctly when they exceed the "max-instatement-indent".
  • Fix quote continuation sometimes being processed as a preprocessor directive (3445475).
  • Fix formatting of some conditional statements on a continuation-line.
  • Fix Java formatting of generics with wildcards (3428140).
  • Fix formatting of pointers and references to work with the new "max-code-length" option.
  • Fix formatting of pointers and references after a template close.
  • Fix formatting of empty attached brackets (3505002).
  • Fix C comments beginning a line breaking if they follow a semi-colon (3502700).
  • Fix "pad-header" not padding "return" and "throw" statements (3509134).
  • Fix recognition problems with templates.
  • Fix "struct" return type being mistaken for a struct.
  • Fix "pad-oper" in java for-each loop.
  • Fix recognition of a macro multi-line comment (3414970).
  • Fix bracketTypeStack entries added by #if and #else if the # is separated from the word.
  • Fix C++ breaking a line on an access modifier in a one-line block when "keep-one-line-blocks" is used.
  • Fix memory leak when "ascii" option is used.
  • Fix memory leak when a preprocessor statement is used without a closing #endif.
  • Fix preprocessor directive to allow compiling with mingw-x64 compiler.
  • Fix redirection on Windows so it does not hang when Linux line ends are used (3514712).
  • Fix redirection on Linux to output the correct line ends (3514712).
  • Fix non-portable return value on locale name (3452574).
  • Fix assert errors caused by not checking the text length on the return from peekNextText().
  • Fix spelling of "depreciated" in help message (3454735).
  • Refactor to improve design and decomposition:
  • Fix warning messages from Visual Studio static code analysis.
  • Fix warning messages from cppcheck, except for constructor uninitialized variables (false positive).
  • Remove astyle_main.h dependency from ASLocalizer.h
  • Remove appendChar() from the inline functions.
  • Extract methods for pointer or reference alignment in ASFormatter.

New in Artistic Style 2.02.1 (Apr 15, 2013)

  • Add to C# the recognition of pointers and address-of operators
  • Improve recognition of pointers and references (3,314,499, 3,298,204, and 2,990,608)
  • Improve alignment of a reference to a pointer (*&)
  • Fix crash with "align-pointer=type" when pointer to pointer (**) starts a new line (3,431,431)
  • Fix breaking after a "case" statement when "break-elseifs" is used without "keep-one-line-statements" (3,421,577, and 3,314,247)
  • Fix "pad-oper" used with "keep-one-line-statements" not padding operators in a one-line "case" statement
  • Fix not recognizing a "pointer dereference" or "address of" that follows a comment (3,431,431)
  • Fix "break-blocks" used with "delete-empty-lines" not correctly breaking blocks on the first run
  • Fix "pad-oper" not padding the alternate comparison operators "and" and "or" (3,342,373)

New in Artistic Style 2.02 (Apr 15, 2013)

  • Add new program module, ASLocalizer, containing language translations
  • Add new short option prefix "x" to allow for expansion of short options
  • Add new command line only option "ascii" (-I)
  • Add new bracket style, "style=pico" (-A11)
  • Add new bracket style, "style=lisp" (-A12)
  • Add new option "align-reference=" (-W#) (3,136,744)
  • Add new options ignore-exclude-errors (-i) and ignore-exclude-errors-x (-xi) (3,259,910)
  • Add new option "style=break" for Allman style brackets
  • Add new option "style=attach" for Java style brackets
  • Add processing of UTF-16 files by converting to UTF-8 and back to UTF-16
  • Add Microsoft C++ extensions for try-finally and try-except statements (3,222,216)
  • Add "override" and "sealed" modifiers (Visual C specific) to preCommandHeaders vector (3,167,978)
  • Add "case" and "default" to the list of formatters in ASFormatter (3,276,212)
  • Remove "indent-brackets" and "indent-blocks" from the valid options
  • Remove "volatile" from headers and remove comparisons in ASBeautifier
  • Change "delete-empty-lines" short option from "x" to "xd"
  • Change "max-instatement-indent" maximum value from 80 to 120 (3,255,930)
  • Change "brackets=horstman" to "brackets=run-in", used for both Horstmann and Pico styles
  • Change C enumerations to allow in-statement indents (3,280,454)
  • Change functions setting the "indent-brackets" and "indent-blocks" variables from public to protected
  • Change to indent lines beginning with an assignment operator (3,292,880)
  • Change to abort if UTF-32 files are detected
  • Change "Cannot set native locale" error message from cout to cerr (3,139,873)
  • Fix Linux infinite loop when a directory name is entered instead of a file name
  • Fix trying to process directories as files when a wildcard is used without recursive (3,134,108)
  • Fix processing a "const" variable as a "const" method when it follows a header (3,168,156)
  • Fix indentation of a one-line block that follows a header
  • Fix breaking a preprocessor define that has code after a comment end (3,132,531)
  • Fix "pad-oper" padding a dereference that follows a C-style cast (3,259,713)
  • Fix "unpad-parens" not recognizing an xor (^) operator (3,285,639)
  • Fix "break-blocks" procedure for "case" and "default" headers
  • Fix "add-brackets" adding brackets to the "while" of a "do-while" loop (3,267,880)
  • Fix "add-brackets" adding brackets to an empty statement
  • Fix "pad-paren" used with "align-pointer=name" incorrectly adding an extra space
  • Fix not clearing a flag when a "?" conditional is included in an "if" statement (2,989,638)
  • Fix incorrect indentation when "volatile" modifier is used (3,279,856)
  • Fix indentation for Microsoft "#pragma region" and "#pragma endregion" preprocessor directives
  • Fix not printing a zero for formatted numbers
  • Fix indentation of a class opening bracket followed by a class modifier on the same line when indent-namespaces and indent-classes are used
  • Refactor to aid debugging, improve speed, and improve the design and decomposition
  • Extract method processProcessor() from beautify() in ASBeautifier
  • Extract method computePreliminaryIndentation() from beautify() in ASBeautifier
  • Extract method parseCurrentLine() from beautify() in ASBeautifier
  • Remove unnecessary copies to outBuffer variable in ASBeautifier
  • Add preCommandHeaders vector to ASBeautifier and remove the "const" modifier comparisons
  • Change static vectors to member variables
  • Add isDigit() function to avoid the assert statements in Visual C

New in Artistic Style 2.01 (Apr 15, 2013)

  • Add recognition of language characters supported by the native locale.
  • Add formatting of numbers according to the native locale.
  • Add checksum verification to source file output.
  • Add formatting of MFC macros BEGIN_DISPATCH_MAP, BEGIN_EVENT_MAP, and BEGIN_PROPPAGEIDS.
  • Add error message if --recursive is used without a wildcard in the file name.
  • Add private (unusable) copy constructors for classes with dynamic allocation.
  • Add error message if the "cin" stream cannot be processed because a pipe is used.
  • Improve recognition of ARRAY_TYPE brackets.
  • Improve formatting of multi-line comments when the number of leading spaces must be changed.
  • Improve formatting of embedded SQL when the number of leading spaces must be changed.
  • Improve recognition of C++ templates.
  • Change --style=linux to always use a minimum conditional indent of one-half the indent length.
  • Change --pad-oper to pad operators in block parens.
  • Change to indent OpenMP pragmas with the code.
  • Change to display all (instead of one) option errors before abort.
  • Change the second argument of the fpError typedef from "char*" to "const char*".
  • Change Linux Makefiles to allow external values for CFLAGS and LDFLAGS.
  • Change all destructors to virtual.
  • Fix crash when --break-blocks is used and there is no closing bracket.
  • Fix deleting the previous line when a closing bracket follows a comment close.
  • Fix not recognizing text in quotes when identifying struct access modifiers.
  • Fix not popping the paren stack when a bracket precedes an end of line comment.
  • Fix not breaking a closing bracket when empty parens are enclosed in a single line block.
  • Fix indenting of C# anonymous statement closing bracket.
  • Fix recognition of C# non in-statement arrays.
  • Fix breaking single line blocks for C# abstract methods.
  • Fix not always clearing isNonInStatementArray flag.
  • Fix indenting "case" statements in a preprocessor definition when --indent-preprocessor is not requested.
  • Fix not recognizing the "volatile" type qualifier as a keyword.
  • Fix class initializers not being recognized as an in-statement indent.
  • Fix indenting Java abstract methods when "new" starts the line and brackets are broken.
  • Fix broken initializer lines (ending with comma) when there is more than one space after the type.
  • Fix --brackets=attach inserting a bracket inside comments following a preprocessor statement.
  • Fix --brackets=attach attaching an array bracket from a one line block to the previous line.
  • Fix --brackets=horstmann not breaking a comment line when the comment ends the line with a bracket.
  • Fix --pad-oper to recognize all * and & operators within a function call.
  • Fix --unpad-paren to recognize * and & operators within a function call.
  • Fix --pad-paren used with --delete-empty-lines causing a space to be added at end of line in some cases.
  • Fix --pad-paren padding a closing paren followed by a block paren.
  • Fix --add-brackets when a header is followed by a semi-colon.
  • Fix --align-pointer to pad or unpad pointers followed by parens or comments.
  • Fix --align-pointer to pad or unpad pointers following a scope resolution operator.
  • Fix --align-pointer to pad or unpad pointers that end the line.
  • Fix --align-pointer used with --pad-parens-out causing a space to be padded for each run.
  • Fix --break-blocks used with --delete-empty-lines causing an assert error when end of file is reached.
  • Fix --break-blocks used with --delete-empty-lines causing an assert error for some combinations of comment lines.
  • Fix --break-blocks used with --delete-empty-lines causing a duplicate line in some cases.
  • Fix --break-blocks used with --delete-empty-lines not always breaking opening blocks.
  • Fix --break-blocks used with --delete-empty-lines not always deleting empty lines for closing blocks.
  • Fix --break-blocks used with --fill-empty-lines not always correctly filling empty lines in a switch statement.
  • Fix --unpad-paren used with --pad-paren-in not padding between opening parens when multiple parens are used.
  • Fix --pad-oper incorrectly padding a template with a default parameter.
  • Fix ASBeautifier findOperator() method to recognize a C# lambda (=>) operator.
  • Fix ASFormatter nextLine() method to output an entire operator instead of individual characters.
  • Fix incorrectly identifying "*" as pointers in block parens.
  • Fix MinGW -Wshadow warnings.
  • Fix VS2010 "string subscript out of range" asserts.
  • Refactor:
  • Remove template definition for parseOptions() by using a vector reference instead of iterators as function arguments.
  • New ASOptions class to encapsulate global functions used by both the console and library builds.
  • Replace argc and argv in processOptions() with a vector to simplify test cases.
  • Replace IS_OPTION and IS_OPTIONS macros with ASOptions methods.
  • Replace GET_PARAM and GET_PARAMS macros with ASOptions methods.
  • Extract ASFormatter methods checkIfTemplateOpener() and isClosingHeader().