overcommit 0.49.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57eb73c3921856cf864136fbf263df0b07d1b07a6acc25a2c0fca6ed1d13a727
|
4
|
+
data.tar.gz: 922db4b368ca43001b2118b2322dbcbb33686ebe8cd434375b52f7b4fc85be14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 795ef9d40b3652122d29c453e572e24d6c3ac363ff1f544d5fbfe806498233b3de445011b11ee5b8679c61796bedb5d69c68ff3e991f9db316e9bf4d01616104
|
7
|
+
data.tar.gz: 91a0072f7c15479c5a78cca91082a32d99b3018cca244e54a10685abad1da8ac11d06193fda4c2434cad69119775d55370b887a4e012fb670917e43fd4f3811d
|
data/config/default.yml
CHANGED
@@ -330,6 +330,13 @@ PreCommit:
|
|
330
330
|
quiet: true
|
331
331
|
branch_patterns: ['master']
|
332
332
|
|
333
|
+
GinkgoFocus:
|
334
|
+
enabled: false
|
335
|
+
description: 'Check for "focused" tests'
|
336
|
+
required_executable: 'grep'
|
337
|
+
flags: ['-IEHnw']
|
338
|
+
keywords: ['FContext','FDescribe','FIt','FMeasure','FSpecify','FWhen']
|
339
|
+
|
333
340
|
GoLint:
|
334
341
|
enabled: false
|
335
342
|
description: 'Analyze with golint'
|
@@ -759,7 +766,7 @@ PreCommit:
|
|
759
766
|
Stylelint:
|
760
767
|
enabled: false
|
761
768
|
description: 'Check styles with Stylelint'
|
762
|
-
|
769
|
+
required_executable: 'stylelint'
|
763
770
|
flags: ['-f', 'compact']
|
764
771
|
install_command: 'npm install -g stylelint'
|
765
772
|
include:
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Overcommit::Hook::PreCommit
|
4
|
+
# Check for "focused" tests
|
5
|
+
class GinkgoFocus < Base
|
6
|
+
def run
|
7
|
+
keywords = config['keywords']
|
8
|
+
result = execute(command, args: [keywords.join('|')] + applicable_files)
|
9
|
+
|
10
|
+
extract_messages(
|
11
|
+
result.stdout.split("\n"),
|
12
|
+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/,
|
13
|
+
lambda { |_type| :warning }
|
14
|
+
)
|
15
|
+
end
|
16
|
+
|
17
|
+
def applicable_test_files
|
18
|
+
applicable_files.select do |f|
|
19
|
+
f if f =~ /_test\.go/
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -15,6 +15,7 @@ module Overcommit::HookContext
|
|
15
15
|
return @amendment unless @amendment.nil?
|
16
16
|
|
17
17
|
cmd = Overcommit::Utils.parent_command
|
18
|
+
return unless cmd
|
18
19
|
amend_pattern = 'commit(\s.*)?\s--amend(\s|$)'
|
19
20
|
|
20
21
|
# Since the ps command can return invalid byte sequences for commands
|
data/lib/overcommit/utils.rb
CHANGED
@@ -133,7 +133,12 @@ module Overcommit
|
|
133
133
|
end
|
134
134
|
|
135
135
|
# Return the parent command that triggered this hook run
|
136
|
+
#
|
137
|
+
# @return [String,nil] the command as a string, if a parent exists.
|
136
138
|
def parent_command
|
139
|
+
# When run in Docker containers, there may be no parent process.
|
140
|
+
return if Process.ppid.zero?
|
141
|
+
|
137
142
|
if OS.windows?
|
138
143
|
`wmic process where ProcessId=#{Process.ppid} get CommandLine /FORMAT:VALUE`.
|
139
144
|
strip.
|
data/lib/overcommit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overcommit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.49.
|
4
|
+
version: 0.49.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: childprocess
|
@@ -138,6 +138,7 @@ files:
|
|
138
138
|
- lib/overcommit/hook/pre_commit/flay.rb
|
139
139
|
- lib/overcommit/hook/pre_commit/foodcritic.rb
|
140
140
|
- lib/overcommit/hook/pre_commit/forbidden_branches.rb
|
141
|
+
- lib/overcommit/hook/pre_commit/ginkgo_focus.rb
|
141
142
|
- lib/overcommit/hook/pre_commit/go_lint.rb
|
142
143
|
- lib/overcommit/hook/pre_commit/go_vet.rb
|
143
144
|
- lib/overcommit/hook/pre_commit/hadolint.rb
|