<div dir="ltr"><div><div>Hi all,<br><br></div>VTK recently changed their code style rules to move curly braces to align with the statement above.  When considering whether to follow this change, the ParaView team has decided to use clang-format to auto-format our code.  I am putting together a branch that will convert all of the ParaView source code to the clang-format style we have chosen [1]*.  Since this branch will touch every C/C++ file, it is guaranteed to conflict will all outstanding branches.<br><br></div><div>Here is the style we have decided on:<br></div><div>---<br># This configuration requires clang-format 3.8 or higher.<br>BasedOnStyle: Mozilla<br>AlignAfterOpenBracket: DontAlign<br>AlignOperands: false<br>AlwaysBreakAfterReturnType: None<br>AlwaysBreakAfterDefinitionReturnType: None<br>BreakBeforeBraces: Allman<br>ColumnLimit: 100<br>Standard: Cpp03<br>...<br><br></div><div>I will be creating a one-shot conversion commit with the author "Kitware Robot" using an automated script to apply the formatting across all of ParaView's source and header files.  We plan to do this after the next RC is tagged.  There will be an empty commit prior to the conversion commit with instructions in its commit message for rebasing current branches across the style transition.<br></div><div><br>We are adding a script in Utilities/Scripts/clang-format.bash to aid in reformatting code.  It has options to reformat the currently changed code, the amend the last commit or rewrite the current branch with the formatting corrected (note: this is assuming the branch is based after the transition commit, rebasing across the transition is trickier).  It also has an option to reformat the entire ParaView codebase that I will be using to automatically convert everything.<br><br></div>Shawn<br><div><br>[1]: <a href="https://gitlab.kitware.com/paraview/paraview/merge_requests/1097" target="_blank">https://gitlab.kitware.com/par<wbr>aview/paraview/merge_requests/<wbr>1097</a><br><br></div><div>*: this branch is out of date right now, but will be rebased and the reformatting re-run before it is merged.<br></div></div>