able_git_hooks 0.9.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edc627c31da0c20e26a37d02937483614ff2467d2b103b5a677804dde8ce9e46
|
4
|
+
data.tar.gz: 3cdbf9533b3fd89c50b867adda4581e51fa1b720a3dd5248d9179f93d9644e81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de0cf62b06fd7649fbad4c5da0e4115b8a942b175c9d3e9ceff34239f0ecbaea7f609f81dff660a2e26ff8d8600b24e7f937bcdc67b7b3f6a9c756e4b2a391e1
|
7
|
+
data.tar.gz: 156c269792873441ed1cf3ea38b400befd8f5cc28a07c2b1b692fc0c23b01d38e1764080769d2cdb8465a9198ab517e1217be6db6c6426c44c0583b921eeab10
|
data/Gemfile.lock
CHANGED
@@ -15,8 +15,8 @@ module AbleGitHooks
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def install_rubocop_hooks
|
18
|
-
copy_file "
|
19
|
-
chmod "hooks/pre-commit/rubocop", 0755
|
18
|
+
copy_file "rubocop.rb", "hooks/pre-commit/rubocop.rb"
|
19
|
+
chmod "hooks/pre-commit/rubocop.rb", 0755
|
20
20
|
end
|
21
21
|
|
22
22
|
def copy_rubocop_defaults
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "rubocop"
|
4
|
+
require "shellwords"
|
5
|
+
|
6
|
+
staged_files = `git diff -z --staged --name-only --diff-filter=ACM`.split("\u0000")
|
7
|
+
config_store = RuboCop::ConfigStore.new
|
8
|
+
target_files = RuboCop::TargetFinder.new(config_store).find(staged_files)
|
9
|
+
|
10
|
+
target_files.each do |target_path|
|
11
|
+
relative = target_path.sub("#{Dir.pwd}/", "")
|
12
|
+
command = %Q(rubocop -R -c config/rubocop.yml --force-exclusion --stdin "#{relative}" < <(git show :"#{relative}"))
|
13
|
+
command = Shellwords.escape(command)
|
14
|
+
|
15
|
+
exit 1 unless system("bash -c #{command}")
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: able_git_hooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Rodas
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-07-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|
@@ -113,8 +113,8 @@ files:
|
|
113
113
|
- lib/able_git_hooks.rb
|
114
114
|
- lib/able_git_hooks/generators/install_generator.rb
|
115
115
|
- lib/able_git_hooks/generators/templates/_do_hook
|
116
|
+
- lib/able_git_hooks/generators/templates/rubocop.rb
|
116
117
|
- lib/able_git_hooks/generators/templates/rubocop.yml
|
117
|
-
- lib/able_git_hooks/generators/templates/rubocop_hook
|
118
118
|
- lib/able_git_hooks/railtie.rb
|
119
119
|
- lib/able_git_hooks/version.rb
|
120
120
|
homepage: http://able.co
|