telegram-bot-rb/telegram-bot

View on GitHub
bin/git-hooks/pre-commit

Summary

Maintainability
Test Coverage
#!/bin/bash

pattern=$(echo -n '\.rb
\.gemspec
\.jbuilder
\.rake
config\.ru
Gemfile
Rakefile' | tr "\\n" '|')

files=`git diff --cached --name-status | grep -E "^[AM].*($pattern)$" | cut -f2-`
if [ -n "$files" ]; then
  bundle exec rubocop $files --force-exclusion
fi