Sha256: ab53b05398bd1ce5e78603dcea8c71c631f687b12a2b750b9dcf2f2029e136f3

Contents?: true

Size: 607 Bytes

Versions: 1

Compression:

Stored size: 607 Bytes

Contents

namespace :pre_commit do
  desc 'Check ruby code style by rubocop'
  task :rubocop do |t|
    Githook::Util.log_task(t.name)
    changed_ruby_files = Githook::Util.changed_ruby_files
    exit 0 if changed_ruby_files.empty?
    exit 1 unless system("bundle exec rubocop #{changed_ruby_files}")
  end

  desc 'Test ruby code by rspec'
  task :rspec do |t|
    Githook::Util.log_task(t.name)
    exit 1 unless system('bundle exec rspec')
  end

  desc 'Check java code style by checkstyle'
  task :checkstyle do |t|
    Githook::Util.log_task(t.name)
    exit 1 unless system('./gradlew checkstyle')
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git-hook-0.2.0 lib/githook/tasks/1-pre-commit.rake