overcommit 0.54.0 → 0.54.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/overcommit/exceptions.rb +19 -16
- data/lib/overcommit/git_repo.rb +10 -9
- data/lib/overcommit/hook/pre_commit/author_name.rb +2 -2
- data/lib/overcommit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e50387bc8d3183940247c41ecbadb7346b5c079eef654f98527e47452c628a9a
|
4
|
+
data.tar.gz: dd5ce92f909df4902d1571c1942767c15e8ce3dcbf834d1e264d0f30c306bb2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab4e383a229204921ce7d4bb78682ac12144adb579b9f97967f63e0ac6d8a27f2dd814ee66696da896fd0cef6c388317bf6f71259bcae8830d6c608f378ed9d1
|
7
|
+
data.tar.gz: 34b9fa4346108b2cbe156808b833fee0f167b48af36577e3aae19f76e5410820c6b8bd1a52e82105683a29db0fbd57dcefdffa936ee45ba033ab398cebbec09b
|
@@ -1,52 +1,55 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Overcommit::Exceptions
|
4
|
+
# Base error class.
|
5
|
+
class Error < StandardError; end
|
6
|
+
|
4
7
|
# Raised when a {Configuration} could not be loaded from a file.
|
5
|
-
class ConfigurationError <
|
8
|
+
class ConfigurationError < Error; end
|
6
9
|
|
7
10
|
# Raised when the Overcommit configuration file signature has changed.
|
8
|
-
class ConfigurationSignatureChanged <
|
11
|
+
class ConfigurationSignatureChanged < Error; end
|
9
12
|
|
10
13
|
# Raised when trying to read/write to/from the local repo git config fails.
|
11
|
-
class GitConfigError <
|
14
|
+
class GitConfigError < Error; end
|
12
15
|
|
13
16
|
# Raised when there was a problem reading submodule information for a repo.
|
14
|
-
class GitSubmoduleError <
|
17
|
+
class GitSubmoduleError < Error; end
|
15
18
|
|
16
19
|
# Raised when there was a problem reading git revision information with `rev-list`.
|
17
|
-
class GitRevListError <
|
20
|
+
class GitRevListError < Error; end
|
18
21
|
|
19
22
|
# Raised when a {HookContext} is unable to setup the environment before a run.
|
20
|
-
class HookSetupFailed <
|
23
|
+
class HookSetupFailed < Error; end
|
21
24
|
|
22
25
|
# Raised when a {HookContext} is unable to clean the environment after a run.
|
23
|
-
class HookCleanupFailed <
|
26
|
+
class HookCleanupFailed < Error; end
|
24
27
|
|
25
28
|
# Raised when a hook run was cancelled by the user.
|
26
|
-
class HookCancelled <
|
29
|
+
class HookCancelled < Error; end
|
27
30
|
|
28
31
|
# Raised when a hook could not be loaded by a {HookRunner}.
|
29
|
-
class HookLoadError <
|
32
|
+
class HookLoadError < Error; end
|
30
33
|
|
31
34
|
# Raised when a {HookRunner} could not be loaded.
|
32
|
-
class HookContextLoadError <
|
35
|
+
class HookContextLoadError < Error; end
|
33
36
|
|
34
37
|
# Raised when a pipe character is used in the `execute` helper, as this was
|
35
38
|
# likely used in error.
|
36
|
-
class InvalidCommandArgs <
|
39
|
+
class InvalidCommandArgs < Error; end
|
37
40
|
|
38
41
|
# Raised when an installation target is not a valid git repository.
|
39
|
-
class InvalidGitRepo <
|
42
|
+
class InvalidGitRepo < Error; end
|
40
43
|
|
41
44
|
# Raised when a hook was defined incorrectly.
|
42
|
-
class InvalidHookDefinition <
|
45
|
+
class InvalidHookDefinition < Error; end
|
43
46
|
|
44
47
|
# Raised when one or more hook plugin signatures have changed.
|
45
|
-
class InvalidHookSignature <
|
48
|
+
class InvalidHookSignature < Error; end
|
46
49
|
|
47
50
|
# Raised when there is a problem processing output into {Hook::Messages}s.
|
48
|
-
class MessageProcessingError <
|
51
|
+
class MessageProcessingError < Error; end
|
49
52
|
|
50
53
|
# Raised when an installation target already contains non-Overcommit hooks.
|
51
|
-
class PreExistingHooks <
|
54
|
+
class PreExistingHooks < Error; end
|
52
55
|
end
|
data/lib/overcommit/git_repo.rb
CHANGED
@@ -109,15 +109,16 @@ module Overcommit
|
|
109
109
|
# @return [Array<String>] list of absolute file paths
|
110
110
|
def list_files(paths = [], options = {})
|
111
111
|
ref = options[:ref] || 'HEAD'
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
112
|
+
|
113
|
+
result = Overcommit::Utils.execute(%W[git ls-tree --name-only #{ref}], args: paths)
|
114
|
+
unless result.success?
|
115
|
+
raise Overcommit::Exceptions::Error,
|
116
|
+
"Error listing files. EXIT STATUS(es): #{result.statuses}.\n" \
|
117
|
+
"STDOUT(s): #{result.stdouts}.\n" \
|
118
|
+
"STDERR(s): #{result.stderrs}."
|
119
|
+
end
|
120
|
+
|
121
|
+
result.stdout.split(/\n/).
|
121
122
|
map { |relative_file| File.expand_path(relative_file) }.
|
122
123
|
reject { |file| File.directory?(file) } # Exclude submodule directories
|
123
124
|
end
|
@@ -12,9 +12,9 @@ module Overcommit::Hook::PreCommit
|
|
12
12
|
result.stdout.chomp
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
if name.empty?
|
16
16
|
return :fail,
|
17
|
-
"Author must
|
17
|
+
"Author name must be non-0 in length.\n" \
|
18
18
|
'Set your name with `git config --global user.name "Your Name"` ' \
|
19
19
|
'or via the GIT_AUTHOR_NAME environment variable'
|
20
20
|
end
|
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.54.
|
4
|
+
version: 0.54.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: 2020-
|
11
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: childprocess
|