Skip to content

Commit 1dfda25

Browse files
authored
meta: fix tooling check (#4592)
1 parent f05aa59 commit 1dfda25

File tree

6 files changed

+10
-312
lines changed

6 files changed

+10
-312
lines changed

Brewfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ brew 'carthage'
44
brew 'rbenv'
55
brew 'pre-commit'
66
brew 'python3'
7-
brew 'jq'
87
tap 'facebook/fb'
98
brew 'facebook/fb/idb-companion'
109
tap 'mobile-dev-inc/tap'

Brewfile.lock.json

Lines changed: 0 additions & 305 deletions
This file was deleted.

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ init:
66
rbenv exec gem update bundler
77
rbenv exec bundle install
88
pre-commit install
9+
clang-format --version | awk '{print $3}' > scripts/.clang-format-version
10+
swiftlint version > scripts/.swiftlint-version
911

1012
.PHONY: check-versions
1113
check-versions:

scripts/.clang-format-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
19.1.5

scripts/.swiftlint-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.57.1

scripts/check-tooling-versions.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/usr/bin/env bash
22

3-
BREW_CLANG_FORMAT_VERSION=$(jq '.entries.brew."clang-format".version' Brewfile.lock.json | sed s/'"'//g)
4-
BREW_SWIFTLINT_VERSION=$(jq '.entries.brew.swiftlint.version' Brewfile.lock.json | sed s/'"'//g)
3+
REMOTE_CLANG_FORMAT_VERSION=$(cat scripts/.clang-format-version)
4+
REMOTE_SWIFTLINT_VERSION=$(cat scripts/.swiftlint-version)
55
LOCAL_CLANG_FORMAT_VERSION=$(clang-format --version | awk '{print $3}')
66
LOCAL_SWIFTLINT_VERSION=$(swiftlint version)
77
RESOLUTION_MESSAGE="Please run \`make init\` to update your local dev tools. This may actually upgrade to a newer version than what is currently recorded in the lockfile; if that happens, please commit the update to the lockfile as well."
88

9-
if [ "${LOCAL_CLANG_FORMAT_VERSION}" != "${BREW_CLANG_FORMAT_VERSION}" ]; then
10-
echo "clang-format version mismatch, expected: ${BREW_CLANG_FORMAT_VERSION}, but found: ${LOCAL_CLANG_FORMAT_VERSION}. ${RESOLUTION_MESSAGE}"
9+
if [ "${LOCAL_CLANG_FORMAT_VERSION}" != "${REMOTE_CLANG_FORMAT_VERSION}" ]; then
10+
echo "clang-format version mismatch, expected: ${REMOTE_CLANG_FORMAT_VERSION}, but found: ${LOCAL_CLANG_FORMAT_VERSION}. ${RESOLUTION_MESSAGE}"
1111
exit 1
1212
fi
1313

14-
if [ "${LOCAL_SWIFTLINT_VERSION}" != "${BREW_SWIFTLINT_VERSION}" ]; then
15-
echo "swiftlint version mismatch, expected: ${BREW_SWIFTLINT_VERSION}, but found: ${LOCAL_SWIFTLINT_VERSION}. ${RESOLUTION_MESSAGE}"
14+
if [ "${LOCAL_SWIFTLINT_VERSION}" != "${REMOTE_SWIFTLINT_VERSION}" ]; then
15+
echo "swiftlint version mismatch, expected: ${REMOTE_SWIFTLINT_VERSION}, but found: ${LOCAL_SWIFTLINT_VERSION}. ${RESOLUTION_MESSAGE}"
1616
exit 1
1717
fi

0 commit comments

Comments
 (0)