Rely on SPM plugins to consume SwiftLint and SwiftFormat
Use their latest releases and fix some violations and issues. # Conflicts: # .github/workflows/linting.yml # .github/workflows/testing.yml
This commit is contained in:
parent
358908f161
commit
1bdf9d684b
40 changed files with 126 additions and 186 deletions
|
|
@ -1,25 +0,0 @@
|
|||
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"
|
||||
SWIFTFORMAT_VERSION="0.51.*"
|
||||
|
||||
if [[ "${CI}" == "true" ]]; then
|
||||
echo "Running in a Continuous Integration environment. Formatting is skipped."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "${CONFIGURATION}" == "Release" ]]; then
|
||||
echo "Running during a release build. Formatting is skipped."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if which swiftformat > /dev/null; then
|
||||
if [[ "$(swiftformat --version)" == $SWIFTFORMAT_VERSION ]]; then
|
||||
swiftformat .
|
||||
else
|
||||
echo "Failure: SwiftFormat $SWIFTFORMAT_VERSION is required. Install it or update the build script to use a newer version."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Failure: SwiftFormat not installed. Get it via 'brew install swiftformat'."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"
|
||||
|
||||
SWIFTLINT_VERSION="0.52.*"
|
||||
|
||||
if [[ "${CI}" == "true" ]]; then
|
||||
echo "Running in a Continuous Integration environment. Linting is skipped."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ "${CONFIGURATION}" == "Release" ]]; then
|
||||
echo "Running during a release build. Linting is skipped."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if which swiftlint > /dev/null; then
|
||||
if [[ "$(swiftlint version)" == $SWIFTLINT_VERSION ]]; then
|
||||
swiftlint --strict
|
||||
else
|
||||
echo "Failure: SwiftLint $SWIFTLINT_VERSION is required. Install it or update the build script to use a newer version."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Failure: SwiftLint not installed. Get it via 'brew install swiftlint'."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue