Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Makefile to call lint shell script #2

Merged
merged 2 commits into from
Feb 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This makefile exposes targets that unify building, testing and archiving of
# PINModel

SWIFT_LINT_EXEC=`which swiftlint`

.PHONY: all clean build test archive

Expand All @@ -11,7 +10,7 @@ clean:
swift build --clean

lint:
$(SWIFT_LINT_EXEC) lint --reporter emoji
./Utility/lint.sh

build: lint
swift build
Expand Down
15 changes: 15 additions & 0 deletions Utility/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

if which swiftlint >/dev/null; then
LINT_ERRS=`swiftlint lint --reporter emoji --quiet`
if [[ $LINT_ERRS != "" ]]; then
echo "Error: Fix lint errors from swiftlint"
echo $LINT_ERRS
exit 1
else
echo "SwiftLint finished: No errors or warnings found."
fi
else
echo "Warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
exit 1
fi