Skip to content

Commit

Permalink
meta: fix tooling check (#4592)
Browse files Browse the repository at this point in the history
  • Loading branch information
armcknight authored Dec 4, 2024
1 parent f05aa59 commit 1dfda25
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 312 deletions.
1 change: 0 additions & 1 deletion Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ brew 'carthage'
brew 'rbenv'
brew 'pre-commit'
brew 'python3'
brew 'jq'
tap 'facebook/fb'
brew 'facebook/fb/idb-companion'
tap 'mobile-dev-inc/tap'
Expand Down
305 changes: 0 additions & 305 deletions Brewfile.lock.json

This file was deleted.

2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ init:
rbenv exec gem update bundler
rbenv exec bundle install
pre-commit install
clang-format --version | awk '{print $3}' > scripts/.clang-format-version
swiftlint version > scripts/.swiftlint-version

.PHONY: check-versions
check-versions:
Expand Down
1 change: 1 addition & 0 deletions scripts/.clang-format-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
19.1.5
1 change: 1 addition & 0 deletions scripts/.swiftlint-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.57.1
12 changes: 6 additions & 6 deletions scripts/check-tooling-versions.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/usr/bin/env bash

BREW_CLANG_FORMAT_VERSION=$(jq '.entries.brew."clang-format".version' Brewfile.lock.json | sed s/'"'//g)
BREW_SWIFTLINT_VERSION=$(jq '.entries.brew.swiftlint.version' Brewfile.lock.json | sed s/'"'//g)
REMOTE_CLANG_FORMAT_VERSION=$(cat scripts/.clang-format-version)
REMOTE_SWIFTLINT_VERSION=$(cat scripts/.swiftlint-version)
LOCAL_CLANG_FORMAT_VERSION=$(clang-format --version | awk '{print $3}')
LOCAL_SWIFTLINT_VERSION=$(swiftlint version)
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."

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

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

0 comments on commit 1dfda25

Please sign in to comment.