[libcxx-commits] [PATCH] D92229: [libc++] Update clang-format configuration

Marek Kurdej via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 29 01:50:14 PST 2021


curdeius updated this revision to Diff 320075.
curdeius added a comment.

Add soft_fail. Revert .clang-format and generate_feature_test_macro_components.py changes.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92229/new/

https://reviews.llvm.org/D92229

Files:
  libcxx/include/vector
  libcxx/utils/ci/buildkite-pipeline.yml
  libcxx/utils/ci/run-buildbot


Index: libcxx/utils/ci/run-buildbot
===================================================================
--- libcxx/utils/ci/run-buildbot
+++ libcxx/utils/ci/run-buildbot
@@ -8,6 +8,7 @@
 #===----------------------------------------------------------------------===##
 
 set -ex
+set -o pipefail
 
 PROGNAME="$(basename "${0}")"
 
@@ -105,6 +106,21 @@
 }
 
 case "${BUILDER}" in
+check-format)
+    clean
+    echo "+++ Checking formatting"
+    # We need to set --extensions so that clang-format checks extensionless files.
+    mkdir -p ${BUILD_DIR}
+    git-clang-format \
+        --binary /usr/bin/clang-format --diff \
+        --extensions ',h,hh,hpp,hxx,c,cc,cxx,cpp' HEAD~1 \
+        -- \
+            libcxx/{benchmarks,include,src,test} \
+            libcxxabi/{fuzz,include,src,test} \
+        | tee ${BUILD_DIR}/clang-format.patch
+    # Check if the diff is empty, fail otherwise.
+    ! grep -q '^--- a' ${BUILD_DIR}/clang-format.patch
+;;
 generic-cxx03)
     export CC=clang
     export CXX=clang++
Index: libcxx/utils/ci/buildkite-pipeline.yml
===================================================================
--- libcxx/utils/ci/buildkite-pipeline.yml
+++ libcxx/utils/ci/buildkite-pipeline.yml
@@ -15,6 +15,21 @@
 #
 
 steps:
+  - label: "Format"
+    command: "libcxx/utils/ci/run-buildbot check-format"
+    artifact_paths:
+      - "**/clang-format.patch"
+    agents:
+      queue: "libcxx-builders"
+    retry:
+      automatic:
+        - exit_status: -1  # Agent was lost
+          limit: 2
+    soft_fail:
+        - exit_status: 1
+
+  - wait
+
   - label: "C++03"
     command: "libcxx/utils/ci/run-buildbot generic-cxx03"
     artifact_paths:
Index: libcxx/include/vector
===================================================================
--- libcxx/include/vector
+++ libcxx/include/vector
@@ -3403,7 +3403,7 @@
 erase_if(vector<_Tp, _Allocator>& __c, _Predicate __pred) {
   auto __old_size = __c.size();
   __c.erase(_VSTD::remove_if(__c.begin(), __c.end(), __pred), __c.end());
-  return __old_size - __c.size();
+    return __old_size - __c.size();
 }
 #endif
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D92229.320075.patch
Type: text/x-patch
Size: 2104 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210129/6452eba0/attachment.bin>


More information about the libcxx-commits mailing list