]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove cmake-format check and support
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 14 Jun 2020 18:45:23 +0000 (20:45 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 17 Jun 2020 07:07:17 +0000 (09:07 +0200)
Motivation:

1. It’s unsatisfying to have to remember to run “make format” after
   editing CMake files. (Clang-Format has more editor integrations, and
   most importantly there are integrations for my editor of choice.)
2. The output of cmake-format seems to be a bit unstable between
   versions.
3. I don’t like some of cmake-format’s formatting choices. This could be
   potentially be improved, though.

Let’s remove the support for now and maybe revisit later.

.cmake-format [deleted file]
.travis.yml
cmake/CodeAnalysis.cmake
cmake/Findlibb2.cmake
cmake/Findzstd.cmake
misc/check_format.sh
misc/format.sh

diff --git a/.cmake-format b/.cmake-format
deleted file mode 100644 (file)
index e0ce1c8..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-# This is for cmake-format.
-# See https://github.com/cheshirekow/cmake_format
-# for GUI integration and more details.
-
-# Installation: pip3 install cmake-format
-
-# cmake-format
-# Execution: cmake-format CMakeLists.txt cmake/*.cmake src/CMakeLists.txt unittest/CMakeLists.txt -i
-bullet_char: '*'
-dangle_parens: false
-enum_char: .
-line_ending: unix
-line_width: 80
-separate_ctrl_name_with_space: false
-separate_fn_name_with_space: false
-tab_size: 2
-max_subgroups_hwrap: 3 # default is 2 which prevents trivial set(key value PARENT_SCOPE)
-
-# cmake-lint
-# Execution: cmake-lint CMakeLists.txt cmake/*.cmake src/CMakeLists.txt unittest/CMakeLists.txt
-max_statement_spacing: 2
index f7119d60a2bc3c02c1ece2a5c281116db607ed0f..fb29537cb1b63cbc4e0b9ecdb1dd27804c9a671c 100644 (file)
@@ -117,7 +117,7 @@ jobs:
         - libzstd1-dev
         - libb2-dev
 
-  # Job 12: Run Clang-Format amd CMake-Format check mode
+  # Job 12: Run Clang-Format in check mode
   - os: linux
     compiler: clang
     env: T="Clang-Format" VERBOSE=1 BUILDEXTRAFLAGS="--target check_format" RUN_TESTS=0
@@ -185,7 +185,7 @@ jobs:
         - libzstd1-dev
         - libb2-dev
 
-  # Job 12: Run Clang-Format amd CMake-Format check mode
+  # Job 12: Run Clang-Format check mode
   - os: linux
     compiler: clang
     env: T="Clang-Format" VERBOSE=1 BUILDEXTRAFLAGS="--target check_format" RUN_TESTS=0
index 17eedf510467153d42fee52ae83bb2486a16d1e6..927486da7be14387e414ba475b5e8f8898b9a4c5 100644 (file)
@@ -6,7 +6,6 @@ if(ENABLE_CPPCHECK)
     find_program(CPPCHECK_EXE cppcheck)
     mark_as_advanced(CPPCHECK_EXE) # don't show in ccmake
     if(CPPCHECK_EXE)
-      # cmake-format: off
       set(CMAKE_CXX_CPPCHECK
           ${CPPCHECK_EXE}
           --suppressions-list=${CMAKE_SOURCE_DIR}/misc/cppcheck-suppressions.txt
@@ -18,7 +17,6 @@ if(ENABLE_CPPCHECK)
           -I ${CMAKE_SOURCE_DIR}
           --template="cppcheck: warning: {id}:{file}:{line}: {message}"
           -i src/third_party)
-      # cmake-format: on
     else()
       message(WARNING "cppcheck requested but executable not found")
     endif()
index 6286164465128d20d340976a371ba30ab7723612..012a14c5f91dbfd2de2268f8ea8eeec3e9966a83 100644 (file)
@@ -97,9 +97,6 @@ else()
 endif()
 
 include(FeatureSummary)
-# cmake-format: off
-# (behaviour change in cmake-format 0.6.10)
 set_package_properties(
   libb2 PROPERTIES URL "http://blake2.net/"
   DESCRIPTION "C library providing BLAKE2b, BLAKE2s, BLAKE2bp, BLAKE2sp")
-# cmake-format: on
index a0095090b616317d0d9b58d26ef004dac755c9d5..758b6cc959fb26371c906fffdb311cbd37e28a8b 100644 (file)
@@ -44,9 +44,6 @@ else()
 endif()
 
 include(FeatureSummary)
-# cmake-format: off
-# (behaviour change in cmake-format 0.6.10)
 set_package_properties(
   zstd PROPERTIES URL "https://facebook.github.io/zstd"
   DESCRIPTION "Zstandard - Fast real-time compression algorithm")
-# cmake-format: on
index dff3d94d08a01e900470702aeb4ea53c5ce60515..7af55d9295ee6e0b60ee54ca9be56cfacd891288 100755 (executable)
@@ -8,17 +8,4 @@ fi
 clang-format --version
 find src unittest -path src/third_party -prune -o -regex ".*\.[ch]p?p?" -print0 | xargs -0 -n1 misc/run-clang-format --check
 
-# Top level CMakeLists.txt + subidrectories.
-# This avoids running the check on any build directories.
-if hash cmake-format 2>/dev/null; then
-  printf "cmake-format version "
-  cmake-format --version
-  CLANG_FORMAT=cmake-format misc/run-clang-format --check CMakeLists.txt
-  find cmake -name "*.cmake" -print0 | CLANG_FORMAT=cmake-format xargs -0 -n1 misc/run-clang-format --check
-  find src unittest -name "CMakeLists.txt" -print0 | CLANG_FORMAT=cmake-format xargs -0 -n1 misc/run-clang-format --check
-else
-  echo "Note: cmake-format not installed. CMake files will not be checked for correct formatting."
-  echo "You can install it via pip3 install cmake-format"
-fi
-
 echo "Format is ok"
index 4e5861703b19097fb47752ef61d38c09bdf8a6bb..0e361a7aa68623e090f975e3327b1055e6453df6 100755 (executable)
@@ -6,15 +6,4 @@ fi
 
 find src unittest -path src/third_party -prune -o -regex ".*\.[ch]p?p?" -exec misc/run-clang-format {} \;
 
-if hash cmake-format 2>/dev/null; then
-  # Top level CMakeLists.txt + subidrectories.
-  # This avoids running the check on any build directories.
-  cmake-format -i CMakeLists.txt
-  find cmake -name "*.cmake" -exec cmake-format -i {} \;
-  find src unittest -name "CMakeLists.txt" -exec cmake-format -i {} \;
-else
-  echo "Note: cmake-format not installed. CMake files will not be formatted."
-  echo "You can install it via pip3 install cmake-format"
-fi
-
 echo "Formatting complete"