You should lint your code using SwiftLint before each commit.
To make that process easier you could install that Git hook that will check code before each commit:
# run this in the project's root folder
cp docs/git-hook-precommit.sh .git/hooks/pre-commit