Skip to content

Commit

Permalink
Merge pull request #2867 from kodebach/cmake-format
Browse files Browse the repository at this point in the history
format: check version of cmake-format
  • Loading branch information
markus2330 committed Aug 9, 2019
2 parents ec02dbc + 76f82fb commit 2edf84c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions doc/news/_preparation_next_release.md
Expand Up @@ -143,6 +143,10 @@ you up to date with the multi-language support provided by Elektra.
- <<TODO>>
- <<TODO>>

### Other

- The reformatting script now checks that the correct version of `cmake-format` is used. _(Klemens Böswirth)_

## Infrastructure

### Cirrus
Expand Down
9 changes: 5 additions & 4 deletions scripts/reformat-cmake
Expand Up @@ -9,14 +9,15 @@ SCRIPTS_DIR=$(dirname "$0")
. "${SCRIPTS_DIR}/include-common"

CMAKE_FORMAT=$(which cmake-format)
CMAKE_FORMAT_VERSION=$("$CMAKE_FORMAT" --version)

cd "$SOURCE"

if [ -z "${CMAKE_FORMAT}" ]; then
printf 2>&1 'Please install `cmake-format`\n'
if [ -z "${CMAKE_FORMAT}" ] || [ "$CMAKE_FORMAT_VERSION" != "0.5.4" ]; then
printf 2>&1 'Please install `cmake-format` version 0.5.4\n'
exit 1
fi

cd "$SOURCE" || exit 1

output=$("${CMAKE_FORMAT}" 2>&1 CMakeLists.txt)

if [ $? != 0 ]; then
Expand Down

0 comments on commit 2edf84c

Please sign in to comment.