pre-commit 0.35.0 → 0.36.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/plugins/pre_commit/checks/rspec_focus.rb +6 -2
- data/lib/pre-commit/checks/grep.rb +18 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac175b7e57416744f8dd4f44288c14dd7df0e4e8
|
4
|
+
data.tar.gz: 0c7b2d185164ab133d07c3fb23fdee40a955a831
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 850f5a706f5cc3261b700d87fcf43c8af49dc87e58821dba225852db48491947c00b9fb8b3a836b8927651e0fe89b556792476b6b65f90e53d9e7c0a07491e1e
|
7
|
+
data.tar.gz: de95b110f459871aeaeb3cf19ffa4e9e6fd220670e76e2c3bb75a61cf45574c9ed759e053d2260938812374273c4bc2fa3df2d09a6cd5ba7ca3566fbeebc3619
|
@@ -9,15 +9,19 @@ module PreCommit
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def message
|
12
|
-
"
|
12
|
+
"focus found in specs:"
|
13
13
|
end
|
14
14
|
|
15
15
|
def pattern
|
16
16
|
"(describe|context|it).*(:focus|focus:).*do"
|
17
17
|
end
|
18
18
|
|
19
|
+
def extra_pattern
|
20
|
+
"(fdescribe|fcontext|fit).*(\"|').*(\"|').*do"
|
21
|
+
end
|
22
|
+
|
19
23
|
def self.description
|
20
|
-
"Finds ruby specs
|
24
|
+
"Finds ruby specs that are focused."
|
21
25
|
end
|
22
26
|
|
23
27
|
end
|
@@ -37,6 +37,10 @@ module PreCommit
|
|
37
37
|
@pattern or raise PaternNotSet.new
|
38
38
|
end
|
39
39
|
|
40
|
+
def extra_pattern
|
41
|
+
@extra_pattern
|
42
|
+
end
|
43
|
+
|
40
44
|
# general code:
|
41
45
|
|
42
46
|
def call(staged_files)
|
@@ -47,7 +51,13 @@ module PreCommit
|
|
47
51
|
in_groups(staged_files).map do |files|
|
48
52
|
args = grep + [pattern] + files
|
49
53
|
args += ["|", "grep"] + extra_grep if !extra_grep.nil? and !extra_grep.empty?
|
50
|
-
|
54
|
+
|
55
|
+
results = [
|
56
|
+
execute(args, success_status: false),
|
57
|
+
extra_execute(files)
|
58
|
+
].compact
|
59
|
+
|
60
|
+
results.empty? ? nil : results.join('')
|
51
61
|
end.compact
|
52
62
|
|
53
63
|
result.empty? ? nil : parse_errors(message, result)
|
@@ -84,6 +94,13 @@ module PreCommit
|
|
84
94
|
`grep --version | head -n 1 | sed -e 's/^[^0-9.]*\([0-9.]*\)$/\1/'`
|
85
95
|
end
|
86
96
|
|
97
|
+
def extra_execute(files)
|
98
|
+
return nil if extra_pattern.nil? or extra_pattern.empty?
|
99
|
+
args = grep + [extra_pattern] + files
|
100
|
+
|
101
|
+
execute(args, success_status: false)
|
102
|
+
end
|
103
|
+
|
87
104
|
end
|
88
105
|
end
|
89
106
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pre-commit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.36.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shajith Chacko, Josh Lubaway
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pluginator
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
186
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.6.
|
187
|
+
rubygems_version: 2.6.13
|
188
188
|
signing_key:
|
189
189
|
specification_version: 3
|
190
190
|
summary: A slightly better git pre-commit hook
|