IGListKit/scripts/lint.sh
Jesse Squires 8dd464e712 Update swiftlint + script, add newrules, autocorrect
Summary:
- Updates to SwiftLint 0.24.2
- Improve `scripts/lint.sh`
    - pull version out to a var for easier maintenance
    - better error message
    - make script fail xcode build if not installed (so we don't commit lint errors)
- Adds a few new SwiftLint rules
- Correct all new lint errors (most can be done by running `swiftlint autocorrect`)
- Cleans up `.swiftlint.yml`
- Fix up example projects
Closes https://github.com/Instagram/IGListKit/pull/1058

Differential Revision: D6776177

Pulled By: rnystrom

fbshipit-source-id: 345172237b97aaed0d62312c8f366f46145f8cd9
2018-01-22 12:14:38 -08:00

14 lines
333 B
Bash
Executable file

#!/bin/bash
VERSION="0.24.2"
if which swiftlint >/dev/null && [ $(swiftlint version) == $VERSION ]; then
swiftlint lint --config ../.swiftlint.yml
else
echo "
Warning: SwiftLint $VERSION not installed!
Download from https://github.com/realm/SwiftLint,
or brew [install | upgrade] swiftlint.
"
exit 1
fi