git-lint 5.3.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/README.adoc +195 -137
- data/git-lint.gemspec +12 -9
- data/lib/git/lint/analyzer.rb +9 -11
- data/lib/git/lint/analyzers/abstract.rb +6 -11
- data/lib/git/lint/analyzers/commit_author_name.rb +1 -1
- data/lib/git/lint/analyzers/commit_body_bullet.rb +3 -1
- data/lib/git/lint/analyzers/commit_body_bullet_capitalization.rb +3 -1
- data/lib/git/lint/analyzers/commit_body_bullet_delimiter.rb +3 -1
- data/lib/git/lint/analyzers/commit_body_line_length.rb +1 -1
- data/lib/git/lint/analyzers/commit_body_phrase.rb +3 -1
- data/lib/git/lint/analyzers/commit_body_presence.rb +1 -1
- data/lib/git/lint/analyzers/commit_body_single_bullet.rb +3 -1
- data/lib/git/lint/analyzers/commit_body_tracker_shorthand.rb +3 -1
- data/lib/git/lint/analyzers/commit_signature.rb +3 -1
- data/lib/git/lint/analyzers/commit_subject_length.rb +1 -1
- data/lib/git/lint/analyzers/commit_subject_prefix.rb +5 -3
- data/lib/git/lint/analyzers/commit_subject_suffix.rb +3 -1
- data/lib/git/lint/analyzers/commit_trailer_collaborator_key.rb +3 -1
- data/lib/git/lint/analyzers/commit_trailer_collaborator_name.rb +1 -1
- data/lib/git/lint/analyzers/commit_trailer_format_key.rb +3 -1
- data/lib/git/lint/analyzers/commit_trailer_format_value.rb +3 -1
- data/lib/git/lint/analyzers/commit_trailer_issue_key.rb +3 -1
- data/lib/git/lint/analyzers/commit_trailer_issue_value.rb +3 -1
- data/lib/git/lint/analyzers/commit_trailer_signer_key.rb +3 -1
- data/lib/git/lint/analyzers/commit_trailer_signer_name.rb +1 -1
- data/lib/git/lint/analyzers/commit_trailer_tracker_key.rb +3 -1
- data/lib/git/lint/analyzers/commit_trailer_tracker_value.rb +3 -1
- data/lib/git/lint/cli/actions/analyze/branch.rb +8 -2
- data/lib/git/lint/cli/actions/analyze/commit.rb +7 -1
- data/lib/git/lint/cli/actions/hook.rb +8 -1
- data/lib/git/lint/cli/shell.rb +26 -27
- data/lib/git/lint/configuration/contract.rb +103 -0
- data/lib/git/lint/configuration/defaults.yml +177 -162
- data/lib/git/lint/configuration/model.rb +97 -0
- data/lib/git/lint/container.rb +16 -2
- data/lib/git/lint/rake/register.rb +1 -1
- data/lib/git/lint/reporters/style.rb +4 -4
- data.tar.gz.sig +0 -0
- metadata +62 -27
- metadata.gz.sig +0 -0
- data/lib/git/lint/cli/actions/config.rb +0 -35
- data/lib/git/lint/cli/actions/container.rb +0 -23
- data/lib/git/lint/cli/actions/import.rb +0 -13
- data/lib/git/lint/cli/parser.rb +0 -37
- data/lib/git/lint/cli/parsers/analyze.rb +0 -41
- data/lib/git/lint/cli/parsers/core.rb +0 -76
- data/lib/git/lint/configuration/content.rb +0 -26
- data/lib/git/lint/configuration/loader.rb +0 -50
- data/lib/git/lint/configuration/setting.rb +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ffca289e0b59fadd72f484cacf157edd85858593f8c8c100f14c4fea847c81f
|
4
|
+
data.tar.gz: 262ecb9b537ca4e748f39ae2a1d5a874bdbf6bb2d944301a5de4d1eab8198866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4e25d238b757637080e02a784a3d2df421fbf52633ca9f933e48bc2f7b8cd4f7d2e96c1c0acc190184bb058fa90d8e9984d131e0bd00cd55de4cfadfbba4298
|
7
|
+
data.tar.gz: b5a690ba1f82862963bb6c45de94933f514a94dc3f01fd2e439dc024f8383a74fb8d65824519bb06da997fa181c01dee1c6013b9f29600666d035cb2d6d0c8dd
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -53,19 +53,22 @@ gem install git-lint
|
|
53
53
|
From the command line, type: `git-lint --help`
|
54
54
|
|
55
55
|
....
|
56
|
-
USAGE
|
57
|
-
-
|
58
|
-
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
56
|
+
USAGE
|
57
|
+
git-lint [OPTIONS]
|
58
|
+
git-lint COMMAND [OPTIONS]
|
59
|
+
|
60
|
+
OPTIONS
|
61
|
+
--hook PATH Hook for analyzing unsaved commits.
|
62
|
+
-v, --version Show version.
|
63
|
+
-h, --help [COMMAND] Show this message.
|
64
|
+
|
65
|
+
COMMANDS
|
66
|
+
config Manage configuration.
|
67
|
+
Path is dynamic per current directory.
|
68
|
+
analyze Analyze branch or commit(s).
|
65
69
|
....
|
66
70
|
|
67
|
-
To check if your Git commit history is clean, run: `git-lint --
|
68
|
-
if at least one issue with error severity is detected.
|
71
|
+
To check if your Git commit history is clean, run: `git-lint analyze --branch`. It will exit with a failure if at least one issue with error severity is detected.
|
69
72
|
|
70
73
|
This gem does not check commits on your default branch (i.e. `main`). This is intentional as you
|
71
74
|
would, generally, not want to rewrite or fix commits on the `main` branch. This gem is best used on
|
@@ -80,7 +83,7 @@ git checkout -b test
|
|
80
83
|
touch text.txt
|
81
84
|
git add --all .
|
82
85
|
git commit --message "This is a bogus commit message that is also terribly long and will word wrap"
|
83
|
-
git-lint --
|
86
|
+
git-lint analyze --branch
|
84
87
|
----
|
85
88
|
|
86
89
|
Output:
|
@@ -110,130 +113,185 @@ variables. The default configuration is:
|
|
110
113
|
|
111
114
|
[source,yaml]
|
112
115
|
----
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
116
|
-
|
117
|
-
|
118
|
-
:
|
119
|
-
|
120
|
-
|
121
|
-
:
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
:
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
:
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
:
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
:
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
:
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
:
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
:
|
200
|
-
:
|
201
|
-
|
202
|
-
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
:
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
:
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
:
|
227
|
-
|
228
|
-
|
229
|
-
:
|
230
|
-
|
231
|
-
|
116
|
+
commits:
|
117
|
+
author:
|
118
|
+
capitalization:
|
119
|
+
enabled: true
|
120
|
+
severity: error
|
121
|
+
email:
|
122
|
+
enabled: true
|
123
|
+
severity: error
|
124
|
+
name:
|
125
|
+
enabled: true
|
126
|
+
severity: error
|
127
|
+
minimum: 2
|
128
|
+
body:
|
129
|
+
bullet:
|
130
|
+
enabled: true
|
131
|
+
severity: error
|
132
|
+
excludes:
|
133
|
+
- "\\*"
|
134
|
+
- "•"
|
135
|
+
bullet_capitalization:
|
136
|
+
enabled: true
|
137
|
+
severity: error
|
138
|
+
includes:
|
139
|
+
- "\\-"
|
140
|
+
bullet_delimiter:
|
141
|
+
enabled: true
|
142
|
+
severity: error
|
143
|
+
includes:
|
144
|
+
- "\\-"
|
145
|
+
leading_line:
|
146
|
+
enabled: true
|
147
|
+
severity: warn
|
148
|
+
line_length:
|
149
|
+
enabled: false
|
150
|
+
severity: error
|
151
|
+
maximum: 72
|
152
|
+
paragraph_capitalization:
|
153
|
+
enabled: true
|
154
|
+
severity: error
|
155
|
+
phrase:
|
156
|
+
enabled: true
|
157
|
+
severity: error
|
158
|
+
excludes:
|
159
|
+
- "absolutely"
|
160
|
+
- "actually"
|
161
|
+
- "all intents and purposes"
|
162
|
+
- "along the lines"
|
163
|
+
- "at this moment in time"
|
164
|
+
- "basically"
|
165
|
+
- "each and every one"
|
166
|
+
- "everyone knows"
|
167
|
+
- "fact of the matter"
|
168
|
+
- "furthermore"
|
169
|
+
- "however"
|
170
|
+
- "in due course"
|
171
|
+
- "in the end"
|
172
|
+
- "last but not least"
|
173
|
+
- "matter of fact"
|
174
|
+
- "obviously"
|
175
|
+
- "of course"
|
176
|
+
- "really"
|
177
|
+
- "simply"
|
178
|
+
- "things being equal"
|
179
|
+
- "would like to"
|
180
|
+
- "\\beasy\\b"
|
181
|
+
- "\\bjust\\b"
|
182
|
+
- "\\bquite\\b"
|
183
|
+
- "as\\sfar\\sas\\s.+\\sconcerned"
|
184
|
+
- "of\\sthe\\s(fact|opinion)\\sthat"
|
185
|
+
presence:
|
186
|
+
enabled: true
|
187
|
+
severity: warn
|
188
|
+
minimum: 1
|
189
|
+
single_bullet:
|
190
|
+
enabled: true
|
191
|
+
severity: error
|
192
|
+
includes:
|
193
|
+
- "\\-"
|
194
|
+
tracker_shorthand:
|
195
|
+
enabled: true
|
196
|
+
severity: error
|
197
|
+
excludes:
|
198
|
+
- "(f|F)ix(es|ed)?\\s\\#\\d+"
|
199
|
+
- "(c|C)lose(s|d)?\\s\\#\\d+"
|
200
|
+
- "(r|R)esolve(s|d)?\\s\\#\\d+"
|
201
|
+
signature:
|
202
|
+
enabled: false
|
203
|
+
severity: error
|
204
|
+
includes:
|
205
|
+
- Good
|
206
|
+
subject:
|
207
|
+
length:
|
208
|
+
enabled: true
|
209
|
+
severity: error
|
210
|
+
maximum: 72
|
211
|
+
prefix:
|
212
|
+
enabled: true
|
213
|
+
severity: error
|
214
|
+
delimiter: " "
|
215
|
+
includes:
|
216
|
+
- Fixed
|
217
|
+
- Added
|
218
|
+
- Updated
|
219
|
+
- Removed
|
220
|
+
- Refactored
|
221
|
+
suffix:
|
222
|
+
enabled: true
|
223
|
+
severity: error
|
224
|
+
excludes:
|
225
|
+
- "\\."
|
226
|
+
- "\\?"
|
227
|
+
- "\\!"
|
228
|
+
trailer:
|
229
|
+
collaborator_capitalization:
|
230
|
+
enabled: true
|
231
|
+
severity: error
|
232
|
+
collaborator_email:
|
233
|
+
enabled: true
|
234
|
+
severity: error
|
235
|
+
collaborator_key:
|
236
|
+
enabled: true
|
237
|
+
severity: error
|
238
|
+
includes:
|
239
|
+
- Co-Authored-By
|
240
|
+
collaborator_name:
|
241
|
+
enabled: true
|
242
|
+
severity: error
|
243
|
+
minimum: 2
|
244
|
+
duplicate:
|
245
|
+
enabled: true
|
246
|
+
severity: error
|
247
|
+
format_key:
|
248
|
+
enabled: true
|
249
|
+
severity: error
|
250
|
+
includes:
|
251
|
+
- Format
|
252
|
+
format_value:
|
253
|
+
enabled: true
|
254
|
+
severity: error
|
255
|
+
includes:
|
256
|
+
- ASCII
|
257
|
+
- Markdown
|
258
|
+
issue_key:
|
259
|
+
enabled: true
|
260
|
+
severity: error
|
261
|
+
includes:
|
262
|
+
- Issue
|
263
|
+
issue_value:
|
264
|
+
enabled: true
|
265
|
+
severity: error
|
266
|
+
includes:
|
267
|
+
- "[\\w-]+"
|
268
|
+
signer_capitalization:
|
269
|
+
enabled: true
|
270
|
+
severity: error
|
271
|
+
signer_email:
|
272
|
+
enabled: true
|
273
|
+
severity: error
|
274
|
+
signer_key:
|
275
|
+
enabled: true
|
276
|
+
severity: error
|
277
|
+
includes:
|
278
|
+
- Signed-By
|
279
|
+
signer_name:
|
280
|
+
enabled: true
|
281
|
+
severity: error
|
282
|
+
minimum: 2
|
283
|
+
tracker_key:
|
284
|
+
enabled: true
|
285
|
+
severity: error
|
286
|
+
includes:
|
287
|
+
- Tracker
|
288
|
+
tracker_value:
|
289
|
+
enabled: true
|
290
|
+
severity: error
|
291
|
+
includes:
|
292
|
+
- "[\\w\\-\\s]+"
|
232
293
|
----
|
233
294
|
|
234
|
-
Feel free to take this default configuration, modify, and save as your own custom
|
235
|
-
`configuration.yml`.
|
236
|
-
|
237
295
|
==== Enablement
|
238
296
|
|
239
297
|
By default, most analyzers are enabled. Accepted values are `true` or `false`. If you wish to
|
@@ -965,11 +1023,11 @@ Whenever you attempt to add a commit, Git Lint will check your commit for issues
|
|
965
1023
|
|
966
1024
|
===== Post Commit
|
967
1025
|
|
968
|
-
The _post-commit_ hook is possible via the
|
1026
|
+
The _post-commit_ hook is possible via the `analyze` command. Usage:
|
969
1027
|
|
970
1028
|
[source,bash]
|
971
1029
|
----
|
972
|
-
git-lint
|
1030
|
+
git-lint analyze --commit SHA
|
973
1031
|
----
|
974
1032
|
|
975
1033
|
The _post-commit_ hook can be used multiple ways but, generally, you'll want to check the last
|
@@ -989,7 +1047,7 @@ if ! command -v git-lint > /dev/null; then
|
|
989
1047
|
exit 1
|
990
1048
|
fi
|
991
1049
|
|
992
|
-
git-lint
|
1050
|
+
git-lint analyze --commit $(git log --pretty=format:%H -1)
|
993
1051
|
----
|
994
1052
|
|
995
1053
|
Whenever a commit has been saved, this script will run Git Lint to check for issues.
|
data/git-lint.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "git-lint"
|
5
|
-
spec.version = "
|
5
|
+
spec.version = "6.0.0"
|
6
6
|
spec.authors = ["Brooke Kuhlmann"]
|
7
7
|
spec.email = ["brooke@alchemists.io"]
|
8
8
|
spec.homepage = "https://alchemists.io/projects/git-lint"
|
@@ -23,16 +23,19 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.cert_chain = [Gem.default_cert_path]
|
24
24
|
|
25
25
|
spec.required_ruby_version = "~> 3.2"
|
26
|
-
spec.add_dependency "cogger", "~> 0.
|
27
|
-
spec.add_dependency "core", "~> 0.1
|
26
|
+
spec.add_dependency "cogger", "~> 0.10"
|
27
|
+
spec.add_dependency "core", "~> 0.1"
|
28
28
|
spec.add_dependency "dry-container", "~> 0.11"
|
29
29
|
spec.add_dependency "dry-monads", "~> 1.6"
|
30
|
-
spec.add_dependency "
|
31
|
-
spec.add_dependency "
|
32
|
-
spec.add_dependency "
|
33
|
-
spec.add_dependency "
|
34
|
-
spec.add_dependency "
|
35
|
-
spec.add_dependency "
|
30
|
+
spec.add_dependency "dry-schema", "~> 1.13"
|
31
|
+
spec.add_dependency "etcher", "~> 0.2"
|
32
|
+
spec.add_dependency "gitt", "~> 2.0"
|
33
|
+
spec.add_dependency "infusible", "~> 2.0"
|
34
|
+
spec.add_dependency "refinements", "~> 11.0"
|
35
|
+
spec.add_dependency "runcom", "~> 10.0"
|
36
|
+
spec.add_dependency "sod", "~> 0.0"
|
37
|
+
spec.add_dependency "spek", "~> 2.0"
|
38
|
+
spec.add_dependency "tone", "~> 0.3"
|
36
39
|
spec.add_dependency "zeitwerk", "~> 2.6"
|
37
40
|
|
38
41
|
spec.bindir = "exe"
|
data/lib/git/lint/analyzer.rb
CHANGED
@@ -72,22 +72,20 @@ module Git
|
|
72
72
|
commits.value_or([]).map { |commit| analyze commit }
|
73
73
|
end
|
74
74
|
|
75
|
-
def analyze commit
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
def analyze(commit) = enabled.map { |id| collector.add load_analyzer(commit, id) }
|
76
|
+
|
77
|
+
# :reek:FeatureEnvy
|
78
|
+
def enabled
|
79
|
+
configuration.to_h
|
80
|
+
.select { |key, value| key.end_with?("enabled") && value == true }
|
81
|
+
.keys
|
82
|
+
.map { |key| key.to_s.sub!("commits_", "commit_").delete_suffix! "_enabled" }
|
79
83
|
end
|
80
84
|
|
81
85
|
def load_analyzer commit, id
|
82
86
|
analyzers.find { |analyzer| analyzer.id == id }
|
83
|
-
.then
|
84
|
-
fail Errors::Base, "Invalid analyzer detected: #{id}." unless analyzer
|
85
|
-
|
86
|
-
analyzer.new commit
|
87
|
-
end
|
87
|
+
.then { |analyzer| analyzer.new commit }
|
88
88
|
end
|
89
|
-
|
90
|
-
def settings = configuration.analyzers
|
91
89
|
end
|
92
90
|
end
|
93
91
|
end
|
@@ -12,10 +12,10 @@ module Git
|
|
12
12
|
|
13
13
|
using ::Refinements::Strings
|
14
14
|
|
15
|
-
LEVELS = %
|
15
|
+
LEVELS = %w[warn error].freeze
|
16
16
|
BODY_OFFSET = 3
|
17
17
|
|
18
|
-
def self.id = to_s.delete_prefix("Git::Lint::Analyzers").snakecase
|
18
|
+
def self.id = to_s.delete_prefix!("Git::Lint::Analyzers").snakecase
|
19
19
|
|
20
20
|
def self.label = to_s.delete_prefix("Git::Lint::Analyzers").titleize
|
21
21
|
|
@@ -29,12 +29,9 @@ module Git
|
|
29
29
|
@filter_list = load_filter_list
|
30
30
|
end
|
31
31
|
|
32
|
-
def enabled? = settings.enabled
|
33
|
-
|
34
32
|
def severity
|
35
|
-
|
36
|
-
|
37
|
-
end
|
33
|
+
configuration.public_send("#{self.class.id}_severity".sub("commit_", "commits_"))
|
34
|
+
.tap { |level| fail Errors::Severity, level unless LEVELS.include? level }
|
38
35
|
end
|
39
36
|
|
40
37
|
def valid?
|
@@ -43,9 +40,9 @@ module Git
|
|
43
40
|
|
44
41
|
def invalid? = !valid?
|
45
42
|
|
46
|
-
def warning? = invalid? && severity ==
|
43
|
+
def warning? = invalid? && severity == "warn"
|
47
44
|
|
48
|
-
def error? = invalid? && severity ==
|
45
|
+
def error? = invalid? && severity == "error"
|
49
46
|
|
50
47
|
def issue
|
51
48
|
fail NotImplementedError, "The `##{__method__}` method must be implemented."
|
@@ -77,8 +74,6 @@ module Git
|
|
77
74
|
def invalid_line? _line
|
78
75
|
fail NotImplementedError, "The `.#{__method__}` method must be implemented."
|
79
76
|
end
|
80
|
-
|
81
|
-
def settings = configuration.find_setting(self.class.id)
|
82
77
|
end
|
83
78
|
end
|
84
79
|
end
|
@@ -18,7 +18,9 @@ module Git
|
|
18
18
|
|
19
19
|
protected
|
20
20
|
|
21
|
-
def load_filter_list
|
21
|
+
def load_filter_list
|
22
|
+
Kit::FilterList.new configuration.commits_body_bullet_capitalization_includes
|
23
|
+
end
|
22
24
|
|
23
25
|
def invalid_line? line
|
24
26
|
line.match?(/\A\s*#{Regexp.union filter_list.to_regexp}\s[[:lower:]]+/)
|
@@ -18,7 +18,9 @@ module Git
|
|
18
18
|
|
19
19
|
protected
|
20
20
|
|
21
|
-
def load_filter_list
|
21
|
+
def load_filter_list
|
22
|
+
Kit::FilterList.new configuration.commits_body_bullet_delimiter_includes
|
23
|
+
end
|
22
24
|
|
23
25
|
def invalid_line?(line) = line.match?(/\A\s*#{pattern}(?!(#{pattern}|\s)).+\Z/)
|
24
26
|
|
@@ -18,7 +18,9 @@ module Git
|
|
18
18
|
|
19
19
|
protected
|
20
20
|
|
21
|
-
def load_filter_list
|
21
|
+
def load_filter_list
|
22
|
+
Kit::FilterList.new configuration.commits_body_phrase_excludes
|
23
|
+
end
|
22
24
|
|
23
25
|
def invalid_line? line
|
24
26
|
line.downcase.match? Regexp.new(
|
@@ -18,7 +18,9 @@ module Git
|
|
18
18
|
|
19
19
|
protected
|
20
20
|
|
21
|
-
def load_filter_list
|
21
|
+
def load_filter_list
|
22
|
+
Kit::FilterList.new configuration.commits_body_single_bullet_includes
|
23
|
+
end
|
22
24
|
|
23
25
|
def invalid_line?(line) = line.match?(/\A#{Regexp.union filter_list.to_regexp}\s+/)
|
24
26
|
end
|
@@ -18,7 +18,9 @@ module Git
|
|
18
18
|
|
19
19
|
protected
|
20
20
|
|
21
|
-
def load_filter_list
|
21
|
+
def load_filter_list
|
22
|
+
Kit::FilterList.new configuration.commits_body_tracker_shorthand_excludes
|
23
|
+
end
|
22
24
|
|
23
25
|
def invalid_line?(line) = line.match?(/.*#{Regexp.union filter_list.to_regexp}.*/)
|
24
26
|
end
|
@@ -21,14 +21,16 @@ module Git
|
|
21
21
|
protected
|
22
22
|
|
23
23
|
def load_filter_list
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
configuration.commits_subject_prefix_includes
|
25
|
+
.map { |prefix| "#{prefix}#{delimiter}" }
|
26
|
+
.then { |list| Kit::FilterList.new list }
|
27
27
|
end
|
28
28
|
|
29
29
|
def locally_prefixed? = !ci? && commit.prefix?
|
30
30
|
|
31
31
|
def ci? = environment["CI"] == "true"
|
32
|
+
|
33
|
+
def delimiter = configuration.commits_subject_prefix_delimiter
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|