You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bn...@apache.org on 2022/06/30 20:53:59 UTC

[trafficserver] branch master updated: Make clang-format not modify ink_autoconf.h.in and ink_autoconf.h (#8935)

This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new c54fbc9a8 Make clang-format not modify ink_autoconf.h.in and ink_autoconf.h (#8935)
c54fbc9a8 is described below

commit c54fbc9a8bb078b3163461ebbed392269cf3ce7f
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Thu Jun 30 15:53:52 2022 -0500

    Make clang-format not modify ink_autoconf.h.in and ink_autoconf.h (#8935)
    
    ink_autoconf.h.in and ink_autoconf.h are generated files created with
    autoconf. After they are made, if the user builds with them and then
    calls the clang-format target, clang-format will dutifully format these
    files according to our .clang-format specification. This then results in
    a future invocation of make rebuilding most of the files in the
    repository because those file are fundamental dependencies in our
    repository.
    
    This patch addresses the issue by simply not calling clang-format on
    these generated, not checked in, files.
    
    This fixes #8934
---
 tools/clang-format.sh | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tools/clang-format.sh b/tools/clang-format.sh
index 246edf072..a22a6935f 100755
--- a/tools/clang-format.sh
+++ b/tools/clang-format.sh
@@ -78,8 +78,15 @@ EOF
       exit 1
   else
       for file in $(find $DIR -iname \*.[ch] -o -iname \*.cc -o -iname \*.h.in); do
-    echo $file
-    ${FORMAT} -i $file
+        # The ink_autoconf.h and ink_autoconf.h.in files are generated files,
+        # so they do not need to be re-formatted by clang-format. Doing so
+        # results in make rebuilding all our files, so we skip formatting them
+        # here.
+        base_name=$(basename ${file})
+        [ ${base_name} = 'ink_autoconf.h.in' -o ${base_name} = 'ink_autoconf.h' ] && continue
+
+        echo $file
+        ${FORMAT} -i $file
       done
   fi
 }