Sha256: 3a3fbd14d20ede4044af1ab384d18fbb632022db52c5bf4d53f043ae267ce5c4

Contents?: true

Size: 497 Bytes

Versions: 24

Compression:

Stored size: 497 Bytes

Contents

#!/usr/bin/env ruby
# Code modified from: https://gist.github.com/hanloong/9849098
require 'English'

changed_files = `git diff --name-only --cached --diff-filter=ACM`.split(%r{\n})
changed_files = changed_files.select { |file_name|
  File.extname(file_name) == '.rb'
}.join(' ')

system("bundle exec rubocop -a #{changed_files}") unless changed_files.empty?

if $CHILD_STATUS.to_s[-1].to_i.zero? && !changed_files.empty?
  system("git add #{changed_files}")
end

exit $CHILD_STATUS.to_s[-1].to_i

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
puppet-resource_api-1.8.13 contrib/pre-commit
puppet-resource_api-1.8.9 contrib/pre-commit
puppet-resource_api-1.8.8 contrib/pre-commit
puppet-resource_api-1.8.12 contrib/pre-commit
puppet-resource_api-1.8.11 contrib/pre-commit
puppet-resource_api-1.8.10 contrib/pre-commit
puppet-resource_api-1.8.7 contrib/pre-commit
puppet-resource_api-1.8.6 contrib/pre-commit
puppet-resource_api-1.6.5 contrib/pre-commit
puppet-resource_api-1.8.4 contrib/pre-commit
puppet-resource_api-1.8.3 contrib/pre-commit
puppet-resource_api-1.8.2 contrib/pre-commit
puppet-resource_api-1.6.4 contrib/pre-commit
puppet-resource_api-1.6.3 contrib/pre-commit
puppet-resource_api-1.7.0 contrib/pre-commit
puppet-resource_api-1.8.1 contrib/pre-commit
puppet-resource_api-1.8.0 contrib/pre-commit
puppet-resource_api-1.6.2 contrib/pre-commit
puppet-resource_api-1.6.1 contrib/pre-commit
puppet-resource_api-1.6.0 contrib/pre-commit