[vtk-developers] Incorrect indentation by vtk_reindent_code.py

Bill Lorensen bill.lorensen at gmail.com
Mon Jul 4 15:57:46 EDT 2016


First, I have mixed emotions about massive changes to fix brace
spacing. Who benefits? Some developers, yes, the customer, no.

There are lots of tools to check indentation and fix it. If we make
vtk-wide changes, I think it is important that the tool only change
whitespace. That means that a git blame -w will retain the last
author's changes. As far as I know, David's python script is the only
tool that does this.

Bill


Bill

On Mon, Jul 4, 2016 at 3:48 PM, Paolo Quadrani <paolo.quadrani at gmail.com> wrote:
> 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
>
> Best Regards
> ---
> .: Paolo Quadrani
>
> :: [nEraLab] - [LinkedIN] - [Twitter] - [SlideShare]
>
> "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
>
>
>
> _______________________________________________
> 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
>
>



-- 
Unpaid intern in BillsBasement at noware dot com


More information about the vtk-developers mailing list