From a527db8ca7c53c765c22763e0e2e2df68c66c09b Mon Sep 17 00:00:00 2001 From: elsid Date: Fri, 10 Mar 2023 15:07:16 +0100 Subject: [PATCH] Enforce space only indendation in CMake files --- .gitlab-ci.yml | 1 + CI/check_cmake_format.sh | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100755 CI/check_cmake_format.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3d4a3ee193..5b0d1c18bd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -132,6 +132,7 @@ Clang_Format: before_script: - CI/install_debian_deps.sh openmw-clang-format script: + - CI/check_cmake_format.sh - CI/check_file_names.sh - CI/check_clang_format.sh diff --git a/CI/check_cmake_format.sh b/CI/check_cmake_format.sh new file mode 100755 index 0000000000..40cd0b77f6 --- /dev/null +++ b/CI/check_cmake_format.sh @@ -0,0 +1,6 @@ +#!/bin/bash -ex + +git ls-files -- ':(exclude)extern/' 'CMakeLists.txt' '*.cmake' | + xargs grep -P '^\s*\t' && + ( echo 'CMake files contain leading tab character. Use only spaces for indentation'; exit -1 ) +exit 0