[vtk-developers] Incorrect indentation by vtk_reindent_code.py

Sean McBride sean at rogue-research.com
Mon Jul 4 15:05:49 EDT 2016


On Sat, 2 Jul 2016 12:53:49 -0400, Bill Lorensen said:

>vtk_reindent_code.py has trouble with for loops after if blocks that
>do not have braces.
>
>See the attached file, around lines 3269 and 3290.
>
>For example, Original:
>int vtkReebGraph::Implementation::GetNumberOfNodes()
>{
>  if(!this->NodeNumber)
>    for(vtkIdType nodeId = 1; nodeId < this->MainNodeTable.Size; nodeId++)
>      {
>      // check if node is cleared
>      if(!(this->GetNode(nodeId)->ArcUpId == ((int)-2)))
>        this->NodeNumber++;
>      }

clang-tidy can find ifs and loops with missing braces and even add them for you:
<http://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html>

After this re-indentation change lands, I'll give it a try...

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the vtk-developers mailing list