Menu

#5739 Add makefile targets for formatting all C++ code

Started
Dan Eble
None
needs_work
Scripts
2020-02-05
2020-02-05
Dan Eble
No

These are not yet intended for routine use by contributors. They are
meant to help explore the differences between astyle and clang-format.

https://codereview.appspot.com/565620043

Discussion

  • David Kastrup

    David Kastrup - 2020-02-05

    Is this a reasonable target for makefiles rather than a script? There are no real dependencies to evaluate since files are formatted in-place?

     
    • Dan Eble

      Dan Eble - 2020-02-05

      I have approached this from the perspective that it might grow to handle use cases like

      1. style is good
      2. edit some files
      3. run the target to restyle changed files (not all 700-some)
      4. goto 2
       
      • David Kastrup

        David Kastrup - 2020-02-05

        "Dan Eble" eble@users.sourceforge.net writes:

        I have approached this from the perspective that it might grow to handle use cases like

        1. style is good
        2. edit some files
        3. run the target to restyle changed files (not all 700-some)
        4. goto 2

        But Make's method of detecting stale dependencies depends on comparing
        the modification date of two files. What am I missing?

        --
        David Kastrup

         
    • Dan Eble

      Dan Eble - 2020-02-05

      ... as well as checking style of changed files automatically as part of make check.

       
  • Dan Eble

    Dan Eble - 2020-02-05

    To be clear about this, if it appears to be half baked, and you don't want half-baked stuff to go in, I won't be offended if you want me to mark it "needs work." This is something that was helpful to me which I thought might be helpful to others interested in bringing the clang-format config to the point that it can be trusted. That's all.

     
  • Dan Eble

    Dan Eble - 2020-02-05
    • Description has changed:

    Diff:

    
    
    • Needs: -->
    • Patch: new --> needs_work
    • Type: Enhancement --> Scripts
     
  • Anonymous

    Anonymous - 2020-02-05

    Passes make, make test-baseline and a full make doc