[vtk-developers] Incorrect indentation by vtk_reindent_code.py

Paolo Quadrani paolo.quadrani at gmail.com
Mon Jul 4 15:48:44 EDT 2016


Hi Bill, David,
maybe Uncrustify can be of some help on managing the indentation braces check. It makes use of a configuration file with which you can specify which are the rules you want to apply to the source file.

http://uncrustify.sourceforge.net <http://uncrustify.sourceforge.net/>

Best Regards
---
.: Paolo Quadrani

:: [nEraLab <http://www.neralab.it/>] - [LinkedIN <http://it.linkedin.com/in/paoloquadrani>] - [Twitter <http://twitter.com/quadrani/>] - [SlideShare <http://www.slideshare.net/quadrani>]

"It always seems impossible until it's done. (N. Mandela)"

> On 04 lug 2016, at 21:05, Sean McBride <sean at rogue-research.com> wrote:
> 
> 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
> 
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
> 
> Search the list archives at: http://markmail.org/search/?q=vtk-developers
> 
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtk-developers
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160704/6b7d344c/attachment.html>


More information about the vtk-developers mailing list