.github/other_project_defaults/lint.sh

38 lines
789 B
Bash
Raw Normal View History

2020-01-26 07:40:40 +00:00
#!/bin/bash
# Created by Jesse Squires
# https://www.jessesquires.com
#
# Copyright © 2020-present Jesse Squires
2020-02-23 20:30:12 +00:00
# https://github.com/jessesquires/.github
2020-01-26 07:40:40 +00:00
#
# SwiftLint
2020-02-12 03:38:54 +00:00
# https://github.com/realm/SwiftLint/releases/latest
2020-01-26 07:40:40 +00:00
# ------------------------------
2020-02-23 20:30:12 +00:00
VERSION="0.39.1"
2020-01-26 07:40:40 +00:00
FOUND=$(swiftlint version)
if which swiftlint >/dev/null; then
swiftlint lint --config ./.swiftlint.yml
exit
else
echo "
Error: SwiftLint not installed!
Download from https://github.com/realm/SwiftLint,
or brew install swiftlint.
"
fi
if [ $(swiftlint version) != $VERSION ]; then
echo "
Warning: incorrect SwiftLint installed!
Expected: $VERSION
Found: $FOUND
Download from https://github.com/realm/SwiftLint,
or brew upgrade swiftlint.
"
fi
exit