overcommit 0.44.0 → 0.45.0
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 +4 -4
- data/config/default.yml +8 -0
- data/lib/overcommit/configuration_loader.rb +1 -1
- data/lib/overcommit/hook/commit_msg/text_width.rb +10 -2
- data/lib/overcommit/hook/pre_commit/license_header.rb +1 -1
- data/lib/overcommit/hook/pre_commit/rails_schema_up_to_date.rb +1 -0
- data/lib/overcommit/hook/pre_push/cargo_test.rb +10 -0
- data/lib/overcommit/os.rb +1 -1
- data/lib/overcommit/utils.rb +3 -1
- data/lib/overcommit/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f1f3224b8c51c6c50b52e986004d11874970a11b9c47780a6ae4c01b9df6ea6
|
4
|
+
data.tar.gz: 4fe8b023481b5e401232a89291a2a6b91223132d15be927568f30770ff9b5d1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b0824349ab9379be8b2ecd1d924ada6f920544a96b6bc84a257e349595c0df65c7e8900883a9928a2e8ca375f3a12efc181e2d5cad7612fdc86c5a44fbd9623
|
7
|
+
data.tar.gz: cfca38d75fee7228b335c2da2a33e34859d726e40dd8423bfaa60f464c79a0aabf7673cd991ab900cd0ed9c1159f76976aac5a24dfb01675348e38871190c9f8
|
data/config/default.yml
CHANGED
@@ -108,6 +108,7 @@ CommitMsg:
|
|
108
108
|
enabled: true
|
109
109
|
description: 'Check text width'
|
110
110
|
max_subject_width: 60
|
111
|
+
min_subject_width: 0
|
111
112
|
max_body_width: 72
|
112
113
|
|
113
114
|
TrailingPeriod:
|
@@ -1117,6 +1118,13 @@ PrePush:
|
|
1117
1118
|
flags: ['--exit-on-warn', '--quiet', '--summary']
|
1118
1119
|
install_command: 'gem install brakeman'
|
1119
1120
|
|
1121
|
+
CargoTest:
|
1122
|
+
enabled: false
|
1123
|
+
description: 'Run tests with cargo'
|
1124
|
+
required_executable: 'cargo'
|
1125
|
+
flags: ['test']
|
1126
|
+
include: 'src/**/*.rs'
|
1127
|
+
|
1120
1128
|
GitLfs:
|
1121
1129
|
enabled: false
|
1122
1130
|
description: 'Upload files tracked by Git LFS'
|
@@ -12,7 +12,7 @@ module Overcommit
|
|
12
12
|
#
|
13
13
|
# @return [Overcommit::Configuration]
|
14
14
|
def default_configuration
|
15
|
-
@
|
15
|
+
@default_configuration ||= load_from_file(DEFAULT_CONFIG_PATH, default: true, verify: false)
|
16
16
|
end
|
17
17
|
|
18
18
|
# Loads configuration from file.
|
@@ -21,9 +21,17 @@ module Overcommit::Hook::CommitMsg
|
|
21
21
|
max_subject_width =
|
22
22
|
config['max_subject_width'] +
|
23
23
|
special_prefix_length(subject)
|
24
|
-
return unless subject.length > max_subject_width
|
25
24
|
|
26
|
-
|
25
|
+
if subject.length > max_subject_width
|
26
|
+
@errors << "Commit message subject must be <= #{max_subject_width} characters"
|
27
|
+
return
|
28
|
+
end
|
29
|
+
|
30
|
+
min_subject_width = config['min_subject_width']
|
31
|
+
if subject.length < min_subject_width
|
32
|
+
@errors << "Commit message subject must be >= #{min_subject_width} characters"
|
33
|
+
return
|
34
|
+
end
|
27
35
|
end
|
28
36
|
|
29
37
|
def find_errors_in_body(lines)
|
data/lib/overcommit/os.rb
CHANGED
data/lib/overcommit/utils.rb
CHANGED
@@ -59,7 +59,9 @@ module Overcommit
|
|
59
59
|
def git_dir
|
60
60
|
@git_dir ||=
|
61
61
|
begin
|
62
|
-
|
62
|
+
cmd = %w[git rev-parse]
|
63
|
+
cmd << (GIT_VERSION < '2.5' ? '--git-dir' : '--git-common-dir')
|
64
|
+
result = execute(cmd)
|
63
65
|
unless result.success?
|
64
66
|
raise Overcommit::Exceptions::InvalidGitRepo,
|
65
67
|
'Unable to determine location of GIT_DIR. ' \
|
data/lib/overcommit/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overcommit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.45.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brigade Engineering
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: childprocess
|
@@ -199,6 +199,7 @@ files:
|
|
199
199
|
- lib/overcommit/hook/pre_commit/yarn_check.rb
|
200
200
|
- lib/overcommit/hook/pre_push/base.rb
|
201
201
|
- lib/overcommit/hook/pre_push/brakeman.rb
|
202
|
+
- lib/overcommit/hook/pre_push/cargo_test.rb
|
202
203
|
- lib/overcommit/hook/pre_push/minitest.rb
|
203
204
|
- lib/overcommit/hook/pre_push/php_unit.rb
|
204
205
|
- lib/overcommit/hook/pre_push/protected_branches.rb
|
@@ -268,7 +269,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
268
269
|
requirements:
|
269
270
|
- - ">="
|
270
271
|
- !ruby/object:Gem::Version
|
271
|
-
version: '2.
|
272
|
+
version: '2.2'
|
272
273
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
273
274
|
requirements:
|
274
275
|
- - ">="
|