overcommit 0.50.0 → 0.54.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/default.yml +39 -1
- data/lib/overcommit/hook/base.rb +15 -1
- data/lib/overcommit/hook/pre_commit/go_fmt.rb +17 -0
- data/lib/overcommit/hook/pre_commit/golangci_lint.rb +21 -0
- data/lib/overcommit/hook/pre_commit/mdl.rb +3 -3
- data/lib/overcommit/hook/pre_commit/php_cs.rb +6 -13
- data/lib/overcommit/hook/pre_commit/pronto.rb +3 -14
- data/lib/overcommit/hook/pre_push/base.rb +21 -0
- data/lib/overcommit/hook/pre_push/go_test.rb +14 -0
- data/lib/overcommit/hook/pre_push/golangci_lint.rb +16 -0
- data/lib/overcommit/hook/pre_push/pronto.rb +12 -0
- data/lib/overcommit/hook/pre_push/protected_branches.rb +40 -15
- data/lib/overcommit/hook/prepare_commit_msg/replace_branch.rb +1 -1
- data/lib/overcommit/hook/shared/pronto.rb +21 -0
- data/lib/overcommit/hook_context/commit_msg.rb +3 -1
- data/lib/overcommit/hook_context/pre_commit.rb +34 -35
- data/lib/overcommit/hook_context/pre_push.rb +9 -0
- data/lib/overcommit/printer.rb +1 -0
- data/lib/overcommit/version.rb +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0efc67b235f1b64200fb3f1980dbbffdadafe330138488842faba82901de4536
|
4
|
+
data.tar.gz: 75e7f62941308e828f498906bd5b8681b9a238336a616aa4c9c69465db4411d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92d6182180b1ea2888f3e93124f011fa22ac6af31e610ed8537e1432a46b2ef731a525743ad39fa3981b772d324504665fd3c391bd157eda305a951962d8bbf9
|
7
|
+
data.tar.gz: ddc6c719c3662f64f9e80d671acf6958e6a9aa75b873d8cef948b17f71d81ae33025cedaa4f1770a7bb39523c1a497bbfff8ebb1e59351e5168be41a31259e26
|
data/config/default.yml
CHANGED
@@ -337,6 +337,23 @@ PreCommit:
|
|
337
337
|
flags: ['-IEHnw']
|
338
338
|
keywords: ['FContext','FDescribe','FIt','FMeasure','FSpecify','FWhen']
|
339
339
|
|
340
|
+
GoFmt:
|
341
|
+
enabled: true
|
342
|
+
description: 'Fix with go fmt'
|
343
|
+
required_executable: 'go'
|
344
|
+
command: ['go', 'fmt']
|
345
|
+
parallelize: false
|
346
|
+
include: '**/*.go'
|
347
|
+
|
348
|
+
GolangciLint:
|
349
|
+
enabled: false
|
350
|
+
description: 'Analyze with golangci-lint'
|
351
|
+
required_executable: 'golangci-lint'
|
352
|
+
install_command: 'go get github.com/golangci/golangci-lint/cmd/golangci-lint'
|
353
|
+
flags: ['--out-format=line-number', '--print-issued-lines=false']
|
354
|
+
command: ['golangci-lint', 'run']
|
355
|
+
include: '**/*.go'
|
356
|
+
|
340
357
|
GoLint:
|
341
358
|
enabled: false
|
342
359
|
description: 'Analyze with golint'
|
@@ -868,7 +885,7 @@ PreCommit:
|
|
868
885
|
enabled: false
|
869
886
|
description: 'Analyze with YAMLlint'
|
870
887
|
required_executable: 'yamllint'
|
871
|
-
flags: ['--format=parsable']
|
888
|
+
flags: ['--format=parsable', '--strict']
|
872
889
|
install_command: 'pip install yamllint'
|
873
890
|
include:
|
874
891
|
- '**/*.yaml'
|
@@ -1253,6 +1270,20 @@ PrePush:
|
|
1253
1270
|
required_executable: 'git-lfs'
|
1254
1271
|
install_command: 'brew install git-lfs'
|
1255
1272
|
|
1273
|
+
GolangciLint:
|
1274
|
+
enabled: false
|
1275
|
+
description: 'Analyze with golangci-lint'
|
1276
|
+
required_executable: 'golangci-lint'
|
1277
|
+
install_command: 'go get github.com/golangci/golangci-lint/cmd/golangci-lint'
|
1278
|
+
flags: ['--out-format=line-number', '--print-issued-lines=false']
|
1279
|
+
command: ['golangci-lint', 'run']
|
1280
|
+
|
1281
|
+
GoTest:
|
1282
|
+
enabled: false
|
1283
|
+
description: 'Run go test suite'
|
1284
|
+
required_executable: 'go'
|
1285
|
+
command: ['go', 'test', './...']
|
1286
|
+
|
1256
1287
|
Minitest:
|
1257
1288
|
enabled: false
|
1258
1289
|
description: 'Run Minitest test suite'
|
@@ -1266,6 +1297,13 @@ PrePush:
|
|
1266
1297
|
flags: ['--bootstrap', 'vendor/autoload.php', 'tests']
|
1267
1298
|
install_command: 'composer require --dev phpunit/phpunit'
|
1268
1299
|
|
1300
|
+
Pronto:
|
1301
|
+
enabled: false
|
1302
|
+
description: 'Analyzing with pronto'
|
1303
|
+
required_executable: 'pronto'
|
1304
|
+
install_command: 'gem install pronto'
|
1305
|
+
flags: ['run', '--exit-code']
|
1306
|
+
|
1269
1307
|
ProtectedBranches:
|
1270
1308
|
enabled: false
|
1271
1309
|
description: 'Check for illegal pushes to protected branches'
|
data/lib/overcommit/hook/base.rb
CHANGED
@@ -79,12 +79,18 @@ module Overcommit::Hook
|
|
79
79
|
@config['enabled'] != false
|
80
80
|
end
|
81
81
|
|
82
|
+
def excluded?
|
83
|
+
exclude_branches.any? { |p| File.fnmatch(p, current_branch) }
|
84
|
+
end
|
85
|
+
|
82
86
|
def skip?
|
83
|
-
@config['skip']
|
87
|
+
@config['skip'] ||
|
88
|
+
(@config['skip_if'] ? execute(@config['skip_if']).success? : false)
|
84
89
|
end
|
85
90
|
|
86
91
|
def run?
|
87
92
|
enabled? &&
|
93
|
+
!excluded? &&
|
88
94
|
!(@config['requires_files'] && applicable_files.empty?)
|
89
95
|
end
|
90
96
|
|
@@ -276,5 +282,13 @@ module Overcommit::Hook
|
|
276
282
|
status
|
277
283
|
end
|
278
284
|
end
|
285
|
+
|
286
|
+
def exclude_branches
|
287
|
+
@config['exclude_branches'] || []
|
288
|
+
end
|
289
|
+
|
290
|
+
def current_branch
|
291
|
+
@current_branch ||= Overcommit::GitRepo.current_branch
|
292
|
+
end
|
279
293
|
end
|
280
294
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Overcommit::Hook::PreCommit
|
4
|
+
# Runs go fmt for all modified Go files
|
5
|
+
class GoFmt < Base
|
6
|
+
def run
|
7
|
+
errors = []
|
8
|
+
applicable_files.each do |file|
|
9
|
+
result = execute(command, args: [file])
|
10
|
+
errors << (result.stdout + result.stderr) unless result.success?
|
11
|
+
end
|
12
|
+
return :pass if errors.empty?
|
13
|
+
|
14
|
+
[:fail, errors.join("\n")]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Overcommit::Hook::PreCommit
|
4
|
+
# Runs `golangci-lint run` against any modified packages
|
5
|
+
#
|
6
|
+
# @see https://github.com/golangci/golangci-lint
|
7
|
+
class GolangciLint < Base
|
8
|
+
def run
|
9
|
+
packages = applicable_files.map { |f| File.dirname(f) }.uniq
|
10
|
+
result = execute(command, args: packages)
|
11
|
+
return :pass if result.success?
|
12
|
+
return [:fail, result.stderr] unless result.stderr.empty?
|
13
|
+
|
14
|
+
extract_messages(
|
15
|
+
result.stdout.split("\n"),
|
16
|
+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+)/,
|
17
|
+
nil
|
18
|
+
)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -19,9 +19,9 @@ module Overcommit::Hook::PreCommit
|
|
19
19
|
json_messages.map do |message|
|
20
20
|
Overcommit::Hook::Message.new(
|
21
21
|
:error,
|
22
|
-
message[
|
23
|
-
message[
|
24
|
-
message[
|
22
|
+
message['filename'],
|
23
|
+
message['line'],
|
24
|
+
"#{message['filename']}:#{message['line']} #{message['rule']} #{message['description']}"
|
25
25
|
)
|
26
26
|
end
|
27
27
|
end
|
@@ -12,21 +12,14 @@ module Overcommit::Hook::PreCommit
|
|
12
12
|
def run
|
13
13
|
messages = []
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
# Discard the csv header
|
21
|
-
rows.shift
|
22
|
-
|
23
|
-
# Push each of the errors in the particular file into the array
|
24
|
-
rows.map do |row|
|
25
|
-
messages << row
|
26
|
-
end
|
27
|
-
end
|
15
|
+
result = execute(command, args: applicable_files)
|
16
|
+
if result.status
|
17
|
+
messages = result.stdout.split("\n")
|
18
|
+
# Discard the csv header
|
19
|
+
messages.shift
|
28
20
|
end
|
29
21
|
|
22
|
+
return :fail if messages.empty? && !result.success?
|
30
23
|
return :pass if messages.empty?
|
31
24
|
|
32
25
|
parse_messages(messages)
|
@@ -1,23 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'overcommit/hook/shared/pronto'
|
4
|
+
|
3
5
|
module Overcommit::Hook::PreCommit
|
4
6
|
# Runs `pronto`
|
5
7
|
#
|
6
8
|
# @see https://github.com/mmozuras/pronto
|
7
9
|
class Pronto < Base
|
8
|
-
|
9
|
-
type.include?('E') ? :error : :warning
|
10
|
-
end
|
11
|
-
|
12
|
-
def run
|
13
|
-
result = execute(command)
|
14
|
-
return :pass if result.success?
|
15
|
-
|
16
|
-
extract_messages(
|
17
|
-
result.stdout.split("\n"),
|
18
|
-
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+) (?<type>[^ ]+)/,
|
19
|
-
MESSAGE_TYPE_CATEGORIZER,
|
20
|
-
)
|
21
|
-
end
|
10
|
+
include Overcommit::Hook::Shared::Pronto
|
22
11
|
end
|
23
12
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'forwardable'
|
4
|
+
require 'overcommit/utils/messages_utils'
|
4
5
|
|
5
6
|
module Overcommit::Hook::PrePush
|
6
7
|
# Functionality common to all pre-push hooks.
|
@@ -8,5 +9,25 @@ module Overcommit::Hook::PrePush
|
|
8
9
|
extend Forwardable
|
9
10
|
|
10
11
|
def_delegators :@context, :remote_name, :remote_url, :pushed_refs
|
12
|
+
|
13
|
+
def run?
|
14
|
+
super &&
|
15
|
+
!exclude_remotes.include?(remote_name) &&
|
16
|
+
(include_remote_ref_deletions? || !@context.remote_ref_deletion?)
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def extract_messages(*args)
|
22
|
+
Overcommit::Utils::MessagesUtils.extract_messages(*args)
|
23
|
+
end
|
24
|
+
|
25
|
+
def exclude_remotes
|
26
|
+
@config['exclude_remotes'] || []
|
27
|
+
end
|
28
|
+
|
29
|
+
def include_remote_ref_deletions?
|
30
|
+
@config['include_remote_ref_deletions']
|
31
|
+
end
|
11
32
|
end
|
12
33
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Overcommit::Hook::PrePush
|
4
|
+
# Runs `go test ./...` command on prepush
|
5
|
+
class GoTest < Base
|
6
|
+
def run
|
7
|
+
result = execute(command)
|
8
|
+
return :pass if result.success?
|
9
|
+
|
10
|
+
output = result.stdout + result.stderr
|
11
|
+
[:fail, output]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Overcommit::Hook::PrePush
|
4
|
+
# Runs golangci-lint
|
5
|
+
#
|
6
|
+
# @see https://github.com/golangci/golangci-lint
|
7
|
+
class GolangciLint < Base
|
8
|
+
def run
|
9
|
+
result = execute(command)
|
10
|
+
return :pass if result.success?
|
11
|
+
|
12
|
+
output = result.stdout + result.stderr
|
13
|
+
[:fail, output]
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Overcommit::Hook::PrePush
|
4
|
-
# Prevents
|
4
|
+
# Prevents updates to specified branches.
|
5
|
+
# Accepts a 'destructive_only' option globally or per branch
|
6
|
+
# to only prevent destructive updates.
|
5
7
|
class ProtectedBranches < Base
|
6
8
|
def run
|
7
9
|
return :pass unless illegal_pushes.any?
|
@@ -17,32 +19,55 @@ module Overcommit::Hook::PrePush
|
|
17
19
|
|
18
20
|
def illegal_pushes
|
19
21
|
@illegal_pushes ||= pushed_refs.select do |pushed_ref|
|
20
|
-
protected?(pushed_ref
|
22
|
+
protected?(pushed_ref)
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
|
-
def protected?(
|
26
|
+
def protected?(ref)
|
27
|
+
find_pattern(ref.remote_ref)&.destructive?(ref)
|
28
|
+
end
|
29
|
+
|
30
|
+
def find_pattern(remote_ref)
|
25
31
|
ref_name = remote_ref[%r{refs/heads/(.*)}, 1]
|
26
|
-
return
|
27
|
-
|
28
|
-
|
32
|
+
return if ref_name.nil?
|
33
|
+
|
34
|
+
patterns.find do |pattern|
|
35
|
+
File.fnmatch(pattern.to_s, ref_name)
|
29
36
|
end
|
30
37
|
end
|
31
38
|
|
32
|
-
def
|
33
|
-
@
|
34
|
-
concat(Array(config['branch_patterns']))
|
39
|
+
def patterns
|
40
|
+
@patterns ||= fetch_patterns
|
35
41
|
end
|
36
42
|
|
37
|
-
def
|
43
|
+
def fetch_patterns
|
44
|
+
branch_configurations.map do |pattern|
|
45
|
+
if pattern.is_a?(Hash)
|
46
|
+
Pattern.new(pattern.keys.first, pattern['destructive_only'])
|
47
|
+
else
|
48
|
+
Pattern.new(pattern, global_destructive_only?)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
def branch_configurations
|
54
|
+
config['branches'].to_a + config['branch_patterns'].to_a
|
55
|
+
end
|
56
|
+
|
57
|
+
def global_destructive_only?
|
38
58
|
config['destructive_only'].nil? || config['destructive_only']
|
39
59
|
end
|
40
60
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
61
|
+
Pattern = Struct.new('Pattern', :name, :destructive_only) do
|
62
|
+
alias_method :to_s, :name
|
63
|
+
alias_method :destructive_only?, :destructive_only
|
64
|
+
|
65
|
+
def destructive?(ref)
|
66
|
+
if destructive_only?
|
67
|
+
ref.destructive?
|
68
|
+
else
|
69
|
+
true
|
70
|
+
end
|
46
71
|
end
|
47
72
|
end
|
48
73
|
end
|
@@ -17,7 +17,7 @@ module Overcommit::Hook::PrepareCommitMsg
|
|
17
17
|
Overcommit::Utils.log.debug("Writing #{commit_message_filename} with #{new_template}")
|
18
18
|
|
19
19
|
modify_commit_message do |old_contents|
|
20
|
-
"#{new_template}
|
20
|
+
"#{new_template} #{old_contents}"
|
21
21
|
end
|
22
22
|
|
23
23
|
:pass
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Overcommit::Hook::Shared
|
4
|
+
# Shared code used by all Pronto hooks. Runs pronto linter.
|
5
|
+
module Pronto
|
6
|
+
MESSAGE_TYPE_CATEGORIZER = lambda do |type|
|
7
|
+
type.include?('E') ? :error : :warning
|
8
|
+
end
|
9
|
+
|
10
|
+
def run
|
11
|
+
result = execute(command)
|
12
|
+
return :pass if result.success?
|
13
|
+
|
14
|
+
extract_messages(
|
15
|
+
result.stdout.split("\n"),
|
16
|
+
/^(?<file>(?:\w:)?[^:]+):(?<line>\d+) (?<type>[^ ]+)/,
|
17
|
+
MESSAGE_TYPE_CATEGORIZER,
|
18
|
+
)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -34,7 +34,9 @@ module Overcommit::HookContext
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def post_fail_message
|
37
|
-
"Failed commit message:\n
|
37
|
+
"Failed commit message:\n#{commit_message_lines.join.chomp}\n\n" \
|
38
|
+
"Try again with your existing commit message by running:\n" \
|
39
|
+
"git commit --edit --file=#{commit_message_file}"
|
38
40
|
end
|
39
41
|
|
40
42
|
private
|
@@ -49,29 +49,15 @@ module Overcommit::HookContext
|
|
49
49
|
Overcommit::GitRepo.store_merge_state
|
50
50
|
Overcommit::GitRepo.store_cherry_pick_state
|
51
51
|
|
52
|
-
if
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
Overcommit::Utils.execute(
|
58
|
-
%w[git -c commit.gpgsign=false stash save --keep-index --quiet] + [stash_message]
|
59
|
-
)
|
60
|
-
end
|
61
|
-
|
62
|
-
unless result.success?
|
63
|
-
# Failure to stash in this case is likely due to a configuration
|
64
|
-
# issue (e.g. author/email not set or GPG signing key incorrect)
|
65
|
-
raise Overcommit::Exceptions::HookSetupFailed,
|
66
|
-
"Unable to setup environment for #{hook_script_name} hook run:" \
|
67
|
-
"\nSTDOUT:#{result.stdout}\nSTDERR:#{result.stderr}"
|
68
|
-
end
|
52
|
+
# Don't attempt to stash changes if all changes are staged, as this
|
53
|
+
# prevents us from modifying files at all, which plays better with
|
54
|
+
# editors/tools which watch for file changes.
|
55
|
+
if !initial_commit? && unstaged_changes?
|
56
|
+
stash_changes
|
69
57
|
|
70
|
-
|
58
|
+
# While running hooks make it appear as if nothing changed
|
59
|
+
restore_modified_times
|
71
60
|
end
|
72
|
-
|
73
|
-
# While running the hooks make it appear as if nothing changed
|
74
|
-
restore_modified_times
|
75
61
|
end
|
76
62
|
|
77
63
|
# Restore unstaged changes and reset file modification times so it appears
|
@@ -82,19 +68,14 @@ module Overcommit::HookContext
|
|
82
68
|
# modification time on the file was newer. This helps us play more nicely
|
83
69
|
# with file watchers.
|
84
70
|
def cleanup_environment
|
85
|
-
unless initial_commit? || (@stash_attempted && !@changes_stashed)
|
86
|
-
clear_working_tree # Ensure working tree is clean before restoring it
|
87
|
-
restore_modified_times
|
88
|
-
end
|
89
|
-
|
90
71
|
if @changes_stashed
|
72
|
+
clear_working_tree
|
91
73
|
restore_working_tree
|
92
74
|
restore_modified_times
|
93
75
|
end
|
94
76
|
|
95
77
|
Overcommit::GitRepo.restore_merge_state
|
96
78
|
Overcommit::GitRepo.restore_cherry_pick_state
|
97
|
-
restore_modified_times
|
98
79
|
end
|
99
80
|
|
100
81
|
# Get a list of added, copied, or modified files that have been staged.
|
@@ -140,6 +121,27 @@ module Overcommit::HookContext
|
|
140
121
|
|
141
122
|
private
|
142
123
|
|
124
|
+
def stash_changes
|
125
|
+
@stash_attempted = true
|
126
|
+
|
127
|
+
stash_message = "Overcommit: Stash of repo state before hook run at #{Time.now}"
|
128
|
+
result = Overcommit::Utils.with_environment('GIT_LITERAL_PATHSPECS' => '0') do
|
129
|
+
Overcommit::Utils.execute(
|
130
|
+
%w[git -c commit.gpgsign=false stash save --keep-index --quiet] + [stash_message]
|
131
|
+
)
|
132
|
+
end
|
133
|
+
|
134
|
+
unless result.success?
|
135
|
+
# Failure to stash in this case is likely due to a configuration
|
136
|
+
# issue (e.g. author/email not set or GPG signing key incorrect)
|
137
|
+
raise Overcommit::Exceptions::HookSetupFailed,
|
138
|
+
"Unable to setup environment for #{hook_script_name} hook run:" \
|
139
|
+
"\nSTDOUT:#{result.stdout}\nSTDERR:#{result.stderr}"
|
140
|
+
end
|
141
|
+
|
142
|
+
@changes_stashed = `git stash list -1`.include?(stash_message)
|
143
|
+
end
|
144
|
+
|
143
145
|
# Clears the working tree so that the stash can be applied.
|
144
146
|
def clear_working_tree
|
145
147
|
removed_submodules = Overcommit::GitRepo.staged_submodule_removals
|
@@ -172,14 +174,11 @@ module Overcommit::HookContext
|
|
172
174
|
end
|
173
175
|
end
|
174
176
|
|
175
|
-
# Returns whether there are any changes to
|
176
|
-
#
|
177
|
-
def
|
178
|
-
|
179
|
-
|
180
|
-
map { |line| line.gsub(/[^\s]+\s+(.+)/, '\\1') }
|
181
|
-
|
182
|
-
modified_files.any?
|
177
|
+
# Returns whether there are any changes to tracked files which have not yet
|
178
|
+
# been staged.
|
179
|
+
def unstaged_changes?
|
180
|
+
result = Overcommit::Utils.execute(%w[git --no-pager diff --quiet])
|
181
|
+
!result.success?
|
183
182
|
end
|
184
183
|
|
185
184
|
# Stores the modification times for all modified files to make it appear like
|
@@ -13,6 +13,15 @@ module Overcommit::HookContext
|
|
13
13
|
@args[1]
|
14
14
|
end
|
15
15
|
|
16
|
+
def remote_ref_deletion?
|
17
|
+
return @remote_ref_deletion if defined?(@remote_ref_deletion)
|
18
|
+
|
19
|
+
@remote_ref_deletion ||= input_lines.
|
20
|
+
first&.
|
21
|
+
split(' ')&.
|
22
|
+
first == '(deleted)'
|
23
|
+
end
|
24
|
+
|
16
25
|
def pushed_refs
|
17
26
|
input_lines.map do |line|
|
18
27
|
PushedRef.new(*line.split(' '))
|
data/lib/overcommit/printer.rb
CHANGED
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.
|
4
|
+
version: 0.54.0
|
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:
|
11
|
+
date: 2020-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: childprocess
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 0.6.3
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '5'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 0.6.3
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '5'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: iniparse
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -139,8 +139,10 @@ files:
|
|
139
139
|
- lib/overcommit/hook/pre_commit/foodcritic.rb
|
140
140
|
- lib/overcommit/hook/pre_commit/forbidden_branches.rb
|
141
141
|
- lib/overcommit/hook/pre_commit/ginkgo_focus.rb
|
142
|
+
- lib/overcommit/hook/pre_commit/go_fmt.rb
|
142
143
|
- lib/overcommit/hook/pre_commit/go_lint.rb
|
143
144
|
- lib/overcommit/hook/pre_commit/go_vet.rb
|
145
|
+
- lib/overcommit/hook/pre_commit/golangci_lint.rb
|
144
146
|
- lib/overcommit/hook/pre_commit/hadolint.rb
|
145
147
|
- lib/overcommit/hook/pre_commit/haml_lint.rb
|
146
148
|
- lib/overcommit/hook/pre_commit/hard_tabs.rb
|
@@ -210,8 +212,11 @@ files:
|
|
210
212
|
- lib/overcommit/hook/pre_push/base.rb
|
211
213
|
- lib/overcommit/hook/pre_push/brakeman.rb
|
212
214
|
- lib/overcommit/hook/pre_push/cargo_test.rb
|
215
|
+
- lib/overcommit/hook/pre_push/go_test.rb
|
216
|
+
- lib/overcommit/hook/pre_push/golangci_lint.rb
|
213
217
|
- lib/overcommit/hook/pre_push/minitest.rb
|
214
218
|
- lib/overcommit/hook/pre_push/php_unit.rb
|
219
|
+
- lib/overcommit/hook/pre_push/pronto.rb
|
215
220
|
- lib/overcommit/hook/pre_push/protected_branches.rb
|
216
221
|
- lib/overcommit/hook/pre_push/pytest.rb
|
217
222
|
- lib/overcommit/hook/pre_push/python_nose.rb
|
@@ -227,6 +232,7 @@ files:
|
|
227
232
|
- lib/overcommit/hook/shared/composer_install.rb
|
228
233
|
- lib/overcommit/hook/shared/index_tags.rb
|
229
234
|
- lib/overcommit/hook/shared/npm_install.rb
|
235
|
+
- lib/overcommit/hook/shared/pronto.rb
|
230
236
|
- lib/overcommit/hook/shared/rake_target.rb
|
231
237
|
- lib/overcommit/hook/shared/submodule_status.rb
|
232
238
|
- lib/overcommit/hook/shared/yarn_install.rb
|
@@ -290,7 +296,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
290
296
|
- !ruby/object:Gem::Version
|
291
297
|
version: '0'
|
292
298
|
requirements: []
|
293
|
-
rubygems_version: 3.
|
299
|
+
rubygems_version: 3.1.1
|
294
300
|
signing_key:
|
295
301
|
specification_version: 4
|
296
302
|
summary: Git hook manager
|