CodeTheChangeUBC/reBOOT

View on GitHub
hooks/pre-commit

Summary

Maintainability
Test Coverage
#!/bin/bash
files=$(git diff --cached --name-only --diff-filter=ACM | grep -v "/vendor" | grep ".js$")

set -e

for file in ${files}; do
  jshint ${file}
  test ! -z "$(diff <(js-beautify ${file}) ${file})" && echo "${file} needs beautification" && exit 1
done

exit 0