[Cmake-commits] CMake branch, next, updated. v3.8.0-rc1-478-ge0fe4bc

Brad King brad.king at kitware.com
Wed Feb 22 16:51:30 EST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  e0fe4bc5ffc8b29bb337113645eb74ace68deada (commit)
       via  b5dc36e1264200bdbdd5a8119b426bc4e3e7ca82 (commit)
      from  2d2c94d08fd5f241bb4a736900d6e5acfe5f686b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e0fe4bc5ffc8b29bb337113645eb74ace68deada
commit e0fe4bc5ffc8b29bb337113645eb74ace68deada
Merge: 2d2c94d b5dc36e
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 22 16:51:29 2017 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Feb 22 16:51:29 2017 -0500

    Merge topic 'clang-format-attrs' into next
    
    b5dc36e1 Revert topic 'clang-format-attrs'


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5dc36e1264200bdbdd5a8119b426bc4e3e7ca82
commit b5dc36e1264200bdbdd5a8119b426bc4e3e7ca82
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Feb 22 16:51:13 2017 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Feb 22 16:51:13 2017 -0500

    Revert topic 'clang-format-attrs'
    
    It will be revised and restored.

diff --git a/.gitattributes b/.gitattributes
index 50fde87..d959918 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,13 +1,6 @@
 .gitattributes   export-ignore
 .hooks*          export-ignore
 
-# Custom attribute to mark sources as using our C code style.
-[attr]our-c-style  whitespace=tab-in-indent  format.clang
-
-# Custom attribute to mark sources as generated.
-# Do not perform whitespace checks.  Do not format.
-[attr]generated  whitespace=-tab-in-indent,-indent-with-non-tab -format.clang
-
 bootstrap        crlf=input
 configure        crlf=input
 *.[1-9]          crlf=input
@@ -23,17 +16,10 @@ configure        crlf=input
 *.sln           -crlf
 *.vcproj        -crlf
 
-*.c              our-c-style
-*.cc             our-c-style
-*.cpp            our-c-style
-*.cu             our-c-style
-*.cxx            our-c-style
-*.h              our-c-style
-*.hh             our-c-style
-*.hpp            our-c-style
-*.hxx            our-c-style
-*.notcu          our-c-style
-
+*.c              whitespace=tab-in-indent
+*.h              whitespace=tab-in-indent
+*.cxx            whitespace=tab-in-indent
+*.txt            whitespace=tab-in-indent
 *.cmake          whitespace=tab-in-indent
+
 *.rst            whitespace=tab-in-indent conflict-marker-size=79
-*.txt            whitespace=tab-in-indent
diff --git a/Source/.gitattributes b/Source/.gitattributes
index 81902f3..dbd6382 100644
--- a/Source/.gitattributes
+++ b/Source/.gitattributes
@@ -1,21 +1,10 @@
-/cmCommandArgumentLexer.cxx        generated
-/cmCommandArgumentLexer.h          generated
-/cmCommandArgumentParser.cxx       generated
-/cmCommandArgumentParserTokens.h   generated
-/cmDependsJavaLexer.cxx            generated
-/cmDependsJavaLexer.h              generated
-/cmDependsJavaParser.cxx           generated
-/cmDependsJavaParserTokens.h       generated
-/cmExprLexer.cxx                   generated
-/cmExprLexer.h                     generated
-/cmExprParser.cxx                  generated
-/cmExprParserTokens.h              generated
-/cmFortranLexer.cxx                generated
-/cmFortranLexer.h                  generated
-/cmFortranParser.cxx               generated
-/cmFortranParserTokens.h           generated
-/cmListFileLexer.c                 generated
-
-# Do not format third-party sources.
-/bindexplib.*                              -format.clang
-/kwsys/**                                  -format.clang
+# Preserve indentation style in generated code.
+cmCommandArgumentLexer.cxx      whitespace=-tab-in-indent,-indent-with-non-tab
+cmCommandArgumentLexer.h        whitespace=-tab-in-indent,-indent-with-non-tab
+cmDependsJavaLexer.cxx          whitespace=-tab-in-indent,-indent-with-non-tab
+cmDependsJavaLexer.h            whitespace=-tab-in-indent,-indent-with-non-tab
+cmExprLexer.cxx                 whitespace=-tab-in-indent,-indent-with-non-tab
+cmExprLexer.h                   whitespace=-tab-in-indent,-indent-with-non-tab
+cmFortranLexer.cxx              whitespace=-tab-in-indent,-indent-with-non-tab
+cmFortranLexer.h                whitespace=-tab-in-indent,-indent-with-non-tab
+cmListFileLexer.c               whitespace=-tab-in-indent,-indent-with-non-tab
diff --git a/Source/CursesDialog/form/.gitattributes b/Source/CursesDialog/form/.gitattributes
deleted file mode 100644
index 405ee74..0000000
--- a/Source/CursesDialog/form/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -format.clang
diff --git a/Tests/CompileFeatures/.gitattributes b/Tests/CompileFeatures/.gitattributes
deleted file mode 100644
index 742b780..0000000
--- a/Tests/CompileFeatures/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-# Do not format a source containing C++11 '>>' syntax as C++98.
-cxx_right_angle_brackets.cpp -format.clang
diff --git a/Tests/PositionIndependentTargets/.gitattributes b/Tests/PositionIndependentTargets/.gitattributes
deleted file mode 100644
index 5ecb721..0000000
--- a/Tests/PositionIndependentTargets/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-# Do not format a source where we want a long line preserved.
-pic_test.h -format.clang
diff --git a/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes b/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes
deleted file mode 100644
index de25724..0000000
--- a/Tests/RunCMake/CommandLine/cmake_depends/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-# Do not format a source encoded in UTF-16.
-test_UTF-16LE.h -format.clang
diff --git a/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes b/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes
deleted file mode 100644
index dc98048..0000000
--- a/Tests/RunCMake/GenerateExportHeader/reference/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-# Exclude reference content from formatting.
-* -format.clang
diff --git a/Utilities/.gitattributes b/Utilities/.gitattributes
index 1dba5d6..c6345eb 100644
--- a/Utilities/.gitattributes
+++ b/Utilities/.gitattributes
@@ -1,7 +1,3 @@
 /Git                    export-ignore
 /GitSetup               export-ignore
 SetupForDevelopment.sh  export-ignore
-
-# Do not format third-party sources.
-/KWIML/**       -format.clang
-/cm*/**         -format.clang
diff --git a/Utilities/Scripts/clang-format.bash b/Utilities/Scripts/clang-format.bash
index 096045c..2b36ac5 100755
--- a/Utilities/Scripts/clang-format.bash
+++ b/Utilities/Scripts/clang-format.bash
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 #=============================================================================
-# Copyright 2015-2017 Kitware, Inc.
+# Copyright 2015-2016 Kitware, Inc.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -106,12 +106,34 @@ case "$mode" in
     *) die "invalid mode: $mode" ;;
 esac
 
-# List files as selected above.
-$git_ls |
+# Filter sources to which our style should apply.
+$git_ls -z -- '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' '*.cu' '*.notcu' |
 
-  # Select sources with our attribute.
-  git check-attr --stdin format.clang |
-  sed -n '/: format\.clang: set$/ {s/:[^:]*:[^:]*$//;p;}'  |
+  # Exclude lexer/parser generator input and output.
+  egrep -z -v '^Source/cmCommandArgumentLexer\.' |
+  egrep -z -v '^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)' |
+  egrep -z -v '^Source/cmDependsJavaLexer\.' |
+  egrep -z -v '^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)' |
+  egrep -z -v '^Source/cmExprLexer\.' |
+  egrep -z -v '^Source/cmExprParser(\.y|\.cxx|Tokens\.h)' |
+  egrep -z -v '^Source/cmFortranLexer\.' |
+  egrep -z -v '^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)' |
+  egrep -z -v '^Source/cmListFileLexer(\.in\.l|\.c)' |
+
+  # Exclude third-party sources.
+  egrep -z -v '^Source/bindexplib' |
+  egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
+  egrep -z -v '^Utilities/(KW|cm).*/' |
+
+  # Exclude reference content.
+  egrep -z -v '^Tests/RunCMake/GenerateExportHeader/reference/' |
+
+  # Exclude manually-formatted sources (e.g. with long lines).
+  egrep -z -v '^Tests/PositionIndependentTargets/pic_test.h' |
+  egrep -z -v '^Tests/CompileFeatures/cxx_right_angle_brackets.cpp' |
+
+  # Exclude sources with encoding not suported by clang-format.
+  egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
 
   # Update sources in-place.
-  xargs -d '\n' "$clang_format" -i
+  xargs -0 "$clang_format" -i

-----------------------------------------------------------------------

Summary of changes:
 .gitattributes                                     |   24 +++----------
 Source/.gitattributes                              |   31 ++++++-----------
 Source/CursesDialog/form/.gitattributes            |    1 -
 Tests/CompileFeatures/.gitattributes               |    2 --
 Tests/PositionIndependentTargets/.gitattributes    |    2 --
 .../CommandLine/cmake_depends/.gitattributes       |    2 --
 .../GenerateExportHeader/reference/.gitattributes  |    2 --
 Utilities/.gitattributes                           |    4 ---
 Utilities/Scripts/clang-format.bash                |   36 ++++++++++++++++----
 9 files changed, 44 insertions(+), 60 deletions(-)
 delete mode 100644 Source/CursesDialog/form/.gitattributes
 delete mode 100644 Tests/CompileFeatures/.gitattributes
 delete mode 100644 Tests/PositionIndependentTargets/.gitattributes
 delete mode 100644 Tests/RunCMake/CommandLine/cmake_depends/.gitattributes
 delete mode 100644 Tests/RunCMake/GenerateExportHeader/reference/.gitattributes


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list