git-lint 6.2.1 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data/README.adoc +234 -104
  4. data/git-lint.gemspec +12 -12
  5. data/lib/git/lint/analyzer.rb +8 -4
  6. data/lib/git/lint/analyzers/abstract.rb +3 -3
  7. data/lib/git/lint/analyzers/commit_author_capitalization.rb +1 -1
  8. data/lib/git/lint/analyzers/commit_body_bullet_capitalization.rb +1 -1
  9. data/lib/git/lint/analyzers/commit_body_bullet_delimiter.rb +1 -1
  10. data/lib/git/lint/analyzers/{commit_body_single_bullet.rb → commit_body_bullet_only.rb} +4 -4
  11. data/lib/git/lint/analyzers/commit_body_phrase.rb +2 -5
  12. data/lib/git/lint/analyzers/commit_body_presence.rb +3 -3
  13. data/lib/git/lint/analyzers/commit_body_tracker_shorthand.rb +2 -2
  14. data/lib/git/lint/analyzers/commit_body_word_repeat.rb +31 -0
  15. data/lib/git/lint/analyzers/commit_signature.rb +2 -2
  16. data/lib/git/lint/analyzers/commit_subject_prefix.rb +3 -3
  17. data/lib/git/lint/analyzers/commit_subject_suffix.rb +2 -2
  18. data/lib/git/lint/analyzers/commit_subject_word_repeat.rb +20 -0
  19. data/lib/git/lint/analyzers/commit_trailer_collaborator_capitalization.rb +2 -2
  20. data/lib/git/lint/analyzers/commit_trailer_collaborator_email.rb +3 -4
  21. data/lib/git/lint/analyzers/commit_trailer_collaborator_key.rb +4 -6
  22. data/lib/git/lint/analyzers/commit_trailer_collaborator_name.rb +2 -2
  23. data/lib/git/lint/analyzers/commit_trailer_format_key.rb +4 -6
  24. data/lib/git/lint/analyzers/commit_trailer_format_value.rb +4 -4
  25. data/lib/git/lint/analyzers/commit_trailer_issue_key.rb +4 -6
  26. data/lib/git/lint/analyzers/commit_trailer_issue_value.rb +4 -4
  27. data/lib/git/lint/analyzers/commit_trailer_milestone_key.rb +33 -0
  28. data/lib/git/lint/analyzers/commit_trailer_milestone_value.rb +35 -0
  29. data/lib/git/lint/analyzers/commit_trailer_order.rb +38 -0
  30. data/lib/git/lint/analyzers/commit_trailer_reviewer_key.rb +33 -0
  31. data/lib/git/lint/analyzers/commit_trailer_reviewer_value.rb +35 -0
  32. data/lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb +2 -2
  33. data/lib/git/lint/analyzers/commit_trailer_signer_email.rb +3 -4
  34. data/lib/git/lint/analyzers/commit_trailer_signer_key.rb +4 -4
  35. data/lib/git/lint/analyzers/commit_trailer_signer_name.rb +2 -2
  36. data/lib/git/lint/analyzers/commit_trailer_tracker_key.rb +4 -6
  37. data/lib/git/lint/analyzers/commit_trailer_tracker_value.rb +4 -4
  38. data/lib/git/lint/commits/{systems → hosts}/circle_ci.rb +2 -2
  39. data/lib/git/lint/commits/{systems → hosts}/container.rb +2 -2
  40. data/lib/git/lint/commits/{systems → hosts}/git_hub_action.rb +2 -2
  41. data/lib/git/lint/commits/{systems → hosts}/import.rb +1 -1
  42. data/lib/git/lint/commits/{systems → hosts}/local.rb +2 -2
  43. data/lib/git/lint/commits/{systems → hosts}/netlify_ci.rb +2 -2
  44. data/lib/git/lint/commits/loader.rb +6 -6
  45. data/lib/git/lint/configuration/contract.rb +19 -11
  46. data/lib/git/lint/configuration/defaults.yml +43 -22
  47. data/lib/git/lint/configuration/model.rb +19 -11
  48. data/lib/git/lint/configuration/trailer.rb +10 -0
  49. data/lib/git/lint/container.rb +28 -6
  50. data/lib/git/lint/errors/severity.rb +6 -1
  51. data/lib/git/lint/kit/filter_list.rb +9 -4
  52. data/lib/git/lint/reporters/branch.rb +5 -5
  53. data/lib/git/lint/validators/name.rb +2 -2
  54. data/lib/git/lint/validators/repeated_word.rb +36 -0
  55. data.tar.gz.sig +0 -0
  56. metadata +40 -35
  57. metadata.gz.sig +0 -0
  58. data/lib/git/lint/analyzers/commit_body_bullet.rb +0 -34
@@ -15,11 +15,33 @@ module Git
15
15
  extend Dry::Container::Mixin
16
16
 
17
17
  namespace :trailers do
18
- register(:collaborator, memoize: true) { /\ACo.*Authored.*By.*\Z/i }
19
- register(:format, memoize: true) { /\AFormat.*\Z/i }
20
- register(:issue, memoize: true) { /\AIssue.*\Z/i }
21
- register(:signer, memoize: true) { /\ASigned.*By.*\Z/i }
22
- register(:tracker, memoize: true) { /\ATracker.*\Z/i }
18
+ register :collaborator, memoize: true do
19
+ Configuration::Trailer[name: "Co-authored-by", pattern: /\ACo.*authored.*by.*\Z/i]
20
+ end
21
+
22
+ register :format, memoize: true do
23
+ Configuration::Trailer[name: "Format", pattern: /\AFormat.*\Z/i]
24
+ end
25
+
26
+ register :issue, memoize: true do
27
+ Configuration::Trailer[name: "Issue", pattern: /\AIssue.*\Z/i]
28
+ end
29
+
30
+ register :milestone, memoize: true do
31
+ Configuration::Trailer[name: "Milestone", pattern: /\AMilestone.*\Z/i]
32
+ end
33
+
34
+ register :reviewer, memoize: true do
35
+ Configuration::Trailer[name: "Reviewer", pattern: /\AReviewer.*\Z/i]
36
+ end
37
+
38
+ register :signer, memoize: true do
39
+ Configuration::Trailer[name: "Signed-off-by", pattern: /\ASigned.*off.*by.*\Z/i]
40
+ end
41
+
42
+ register :tracker, memoize: true do
43
+ Configuration::Trailer[name: "Tracker", pattern: /\ATracker.*\Z/i]
44
+ end
23
45
  end
24
46
 
25
47
  namespace :parsers do
@@ -27,7 +49,6 @@ module Git
27
49
  end
28
50
 
29
51
  namespace :sanitizers do
30
- register(:email) { Gitt::Sanitizers::Email }
31
52
  register(:signature) { Gitt::Sanitizers::Signature }
32
53
  end
33
54
 
@@ -35,6 +56,7 @@ module Git
35
56
  register(:capitalization, memoize: true) { Validators::Capitalization.new }
36
57
  register(:email, memoize: true) { Validators::Email.new }
37
58
  register(:name, memoize: true) { Validators::Name.new }
59
+ register(:repeated_word, memoize: true) { Validators::RepeatedWord.new }
38
60
  end
39
61
 
40
62
  register :configuration, memoize: true do
@@ -1,12 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "refinements/array"
4
+
3
5
  module Git
4
6
  module Lint
5
7
  module Errors
6
8
  # Categorizes severity errors.
7
9
  class Severity < Base
10
+ using Refinements::Array
11
+
8
12
  def initialize level
9
- super %(Invalid severity level: #{level}. Use: #{Analyzers::Abstract::LEVELS.join ", "}.)
13
+ usage = Analyzers::Abstract::LEVELS.to_usage "or"
14
+ super %(Invalid severity level: #{level}. Use: #{usage}.)
10
15
  end
11
16
  end
12
17
  end
@@ -1,21 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "core"
4
+ require "refinements/array"
4
5
 
5
6
  module Git
6
7
  module Lint
7
8
  module Kit
8
9
  # Represents an regular expression list which may be used as an analyzer setting.
9
10
  class FilterList
11
+ using Refinements::Array
12
+
10
13
  def initialize list = Core::EMPTY_ARRAY
11
- @list = Array list
14
+ @list = Array(list).map { |item| Regexp.new item }
12
15
  end
13
16
 
14
- def to_hint = to_regexp.map(&:inspect).join(", ")
17
+ def empty? = list.empty?
18
+
19
+ def to_a = list
15
20
 
16
- def to_regexp = list.map { |item| Regexp.new item }
21
+ alias to_ary to_a
17
22
 
18
- def empty? = list.empty?
23
+ def to_usage(...) = list.to_usage(...)
19
24
 
20
25
  private
21
26
 
@@ -6,7 +6,7 @@ module Git
6
6
  # Reports issues related to a single branch.
7
7
  class Branch
8
8
  include Import[:color]
9
- using ::Refinements::Strings
9
+ using Refinements::String
10
10
 
11
11
  def initialize(collector: Collector.new, **)
12
12
  super(**)
@@ -38,7 +38,7 @@ module Git
38
38
 
39
39
  def commit_total
40
40
  total = collector.total_commits
41
- %(#{total} #{"commit".pluralize "s", count: total} inspected)
41
+ %(#{total} #{"commit".pluralize "s", total} inspected)
42
42
  end
43
43
 
44
44
  def issue_totals
@@ -52,19 +52,19 @@ module Git
52
52
  def issue_total
53
53
  style = collector.errors? ? :red : :yellow
54
54
  total = collector.total_issues
55
- color["#{total} issue".pluralize("s", count: total), style]
55
+ color["#{total} issue".pluralize("s", total), style]
56
56
  end
57
57
 
58
58
  def warning_total
59
59
  style = collector.warnings? ? :yellow : :green
60
60
  total = collector.total_warnings
61
- color["#{total} warning".pluralize("s", count: total), style]
61
+ color["#{total} warning".pluralize("s", total), style]
62
62
  end
63
63
 
64
64
  def error_total
65
65
  style = collector.errors? ? :red : :green
66
66
  total = collector.total_errors
67
- color["#{total} error".pluralize("s", count: total), style]
67
+ color["#{total} error".pluralize("s", total), style]
68
68
  end
69
69
  end
70
70
  end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "refinements/strings"
3
+ require "refinements/string"
4
4
 
5
5
  module Git
6
6
  module Lint
7
7
  module Validators
8
8
  # Validates the format of names.
9
9
  class Name
10
- using Refinements::Strings
10
+ using Refinements::String
11
11
 
12
12
  DELIMITER = /\s{1}/
13
13
  MINIMUM = 2
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "core"
4
+
5
+ module Git
6
+ module Lint
7
+ module Validators
8
+ # Validates content has no repeated words.
9
+ class RepeatedWord
10
+ PATTERN = /
11
+ \w+(?=\s) # Match word with trailing space.
12
+ | # Or.
13
+ (?<=\s)\w+(?=\s) # Match word between two spaces.
14
+ | # Or.
15
+ (?<=\s)\w+ # Match word with leading space.
16
+ /x
17
+
18
+ def initialize pattern: PATTERN
19
+ @pattern = pattern
20
+ end
21
+
22
+ def call(content) = content ? scan(content) : Core::EMPTY_ARRAY
23
+
24
+ private
25
+
26
+ attr_reader :pattern
27
+
28
+ def scan content
29
+ content.scan(pattern).each_cons(2).with_object [] do |(current, future), repeats|
30
+ repeats.append future if current.casecmp(future).zero?
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.1
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -35,7 +35,7 @@ cert_chain:
35
35
  3n5C8/6Zh9DYTkpcwPSuIfAga6wf4nXc9m6JAw8AuMLaiWN/r/2s4zJsUHYERJEu
36
36
  gZGm4JqtuSg8pYjPeIJxS960owq+SfuC+jxqmRA54BisFCv/0VOJi7tiJVY=
37
37
  -----END CERTIFICATE-----
38
- date: 2023-11-16 00:00:00.000000000 Z
38
+ date: 2024-01-01 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: cogger
@@ -43,28 +43,28 @@ dependencies:
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.12'
46
+ version: '0.15'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '0.12'
53
+ version: '0.15'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: core
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.1'
60
+ version: '1.0'
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.1'
67
+ version: '1.0'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: dry-container
70
70
  requirement: !ruby/object:Gem::Requirement
@@ -113,112 +113,112 @@ dependencies:
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '0.2'
116
+ version: '1.0'
117
117
  type: :runtime
118
118
  prerelease: false
119
119
  version_requirements: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '0.2'
123
+ version: '1.0'
124
124
  - !ruby/object:Gem::Dependency
125
125
  name: gitt
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '2.0'
130
+ version: '3.0'
131
131
  type: :runtime
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '2.0'
137
+ version: '3.0'
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: infusible
140
140
  requirement: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '2.2'
144
+ version: '3.0'
145
145
  type: :runtime
146
146
  prerelease: false
147
147
  version_requirements: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: '2.2'
151
+ version: '3.0'
152
152
  - !ruby/object:Gem::Dependency
153
153
  name: refinements
154
154
  requirement: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '11.0'
158
+ version: '12.0'
159
159
  type: :runtime
160
160
  prerelease: false
161
161
  version_requirements: !ruby/object:Gem::Requirement
162
162
  requirements:
163
163
  - - "~>"
164
164
  - !ruby/object:Gem::Version
165
- version: '11.0'
165
+ version: '12.0'
166
166
  - !ruby/object:Gem::Dependency
167
167
  name: runcom
168
168
  requirement: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - "~>"
171
171
  - !ruby/object:Gem::Version
172
- version: '10.0'
172
+ version: '11.0'
173
173
  type: :runtime
174
174
  prerelease: false
175
175
  version_requirements: !ruby/object:Gem::Requirement
176
176
  requirements:
177
177
  - - "~>"
178
178
  - !ruby/object:Gem::Version
179
- version: '10.0'
179
+ version: '11.0'
180
180
  - !ruby/object:Gem::Dependency
181
181
  name: sod
182
182
  requirement: !ruby/object:Gem::Requirement
183
183
  requirements:
184
184
  - - "~>"
185
185
  - !ruby/object:Gem::Version
186
- version: '0.0'
186
+ version: '0.4'
187
187
  type: :runtime
188
188
  prerelease: false
189
189
  version_requirements: !ruby/object:Gem::Requirement
190
190
  requirements:
191
191
  - - "~>"
192
192
  - !ruby/object:Gem::Version
193
- version: '0.0'
193
+ version: '0.4'
194
194
  - !ruby/object:Gem::Dependency
195
195
  name: spek
196
196
  requirement: !ruby/object:Gem::Requirement
197
197
  requirements:
198
198
  - - "~>"
199
199
  - !ruby/object:Gem::Version
200
- version: '2.0'
200
+ version: '3.0'
201
201
  type: :runtime
202
202
  prerelease: false
203
203
  version_requirements: !ruby/object:Gem::Requirement
204
204
  requirements:
205
205
  - - "~>"
206
206
  - !ruby/object:Gem::Version
207
- version: '2.0'
207
+ version: '3.0'
208
208
  - !ruby/object:Gem::Dependency
209
209
  name: tone
210
210
  requirement: !ruby/object:Gem::Requirement
211
211
  requirements:
212
212
  - - "~>"
213
213
  - !ruby/object:Gem::Version
214
- version: '0.3'
214
+ version: '1.0'
215
215
  type: :runtime
216
216
  prerelease: false
217
217
  version_requirements: !ruby/object:Gem::Requirement
218
218
  requirements:
219
219
  - - "~>"
220
220
  - !ruby/object:Gem::Version
221
- version: '0.3'
221
+ version: '1.0'
222
222
  - !ruby/object:Gem::Dependency
223
223
  name: zeitwerk
224
224
  requirement: !ruby/object:Gem::Requirement
@@ -253,20 +253,21 @@ files:
253
253
  - lib/git/lint/analyzers/commit_author_capitalization.rb
254
254
  - lib/git/lint/analyzers/commit_author_email.rb
255
255
  - lib/git/lint/analyzers/commit_author_name.rb
256
- - lib/git/lint/analyzers/commit_body_bullet.rb
257
256
  - lib/git/lint/analyzers/commit_body_bullet_capitalization.rb
258
257
  - lib/git/lint/analyzers/commit_body_bullet_delimiter.rb
258
+ - lib/git/lint/analyzers/commit_body_bullet_only.rb
259
259
  - lib/git/lint/analyzers/commit_body_leading_line.rb
260
260
  - lib/git/lint/analyzers/commit_body_line_length.rb
261
261
  - lib/git/lint/analyzers/commit_body_paragraph_capitalization.rb
262
262
  - lib/git/lint/analyzers/commit_body_phrase.rb
263
263
  - lib/git/lint/analyzers/commit_body_presence.rb
264
- - lib/git/lint/analyzers/commit_body_single_bullet.rb
265
264
  - lib/git/lint/analyzers/commit_body_tracker_shorthand.rb
265
+ - lib/git/lint/analyzers/commit_body_word_repeat.rb
266
266
  - lib/git/lint/analyzers/commit_signature.rb
267
267
  - lib/git/lint/analyzers/commit_subject_length.rb
268
268
  - lib/git/lint/analyzers/commit_subject_prefix.rb
269
269
  - lib/git/lint/analyzers/commit_subject_suffix.rb
270
+ - lib/git/lint/analyzers/commit_subject_word_repeat.rb
270
271
  - lib/git/lint/analyzers/commit_trailer_collaborator_capitalization.rb
271
272
  - lib/git/lint/analyzers/commit_trailer_collaborator_email.rb
272
273
  - lib/git/lint/analyzers/commit_trailer_collaborator_key.rb
@@ -276,6 +277,11 @@ files:
276
277
  - lib/git/lint/analyzers/commit_trailer_format_value.rb
277
278
  - lib/git/lint/analyzers/commit_trailer_issue_key.rb
278
279
  - lib/git/lint/analyzers/commit_trailer_issue_value.rb
280
+ - lib/git/lint/analyzers/commit_trailer_milestone_key.rb
281
+ - lib/git/lint/analyzers/commit_trailer_milestone_value.rb
282
+ - lib/git/lint/analyzers/commit_trailer_order.rb
283
+ - lib/git/lint/analyzers/commit_trailer_reviewer_key.rb
284
+ - lib/git/lint/analyzers/commit_trailer_reviewer_value.rb
279
285
  - lib/git/lint/analyzers/commit_trailer_signer_capitalization.rb
280
286
  - lib/git/lint/analyzers/commit_trailer_signer_email.rb
281
287
  - lib/git/lint/analyzers/commit_trailer_signer_key.rb
@@ -287,16 +293,17 @@ files:
287
293
  - lib/git/lint/cli/actions/hook.rb
288
294
  - lib/git/lint/cli/shell.rb
289
295
  - lib/git/lint/collector.rb
296
+ - lib/git/lint/commits/hosts/circle_ci.rb
297
+ - lib/git/lint/commits/hosts/container.rb
298
+ - lib/git/lint/commits/hosts/git_hub_action.rb
299
+ - lib/git/lint/commits/hosts/import.rb
300
+ - lib/git/lint/commits/hosts/local.rb
301
+ - lib/git/lint/commits/hosts/netlify_ci.rb
290
302
  - lib/git/lint/commits/loader.rb
291
- - lib/git/lint/commits/systems/circle_ci.rb
292
- - lib/git/lint/commits/systems/container.rb
293
- - lib/git/lint/commits/systems/git_hub_action.rb
294
- - lib/git/lint/commits/systems/import.rb
295
- - lib/git/lint/commits/systems/local.rb
296
- - lib/git/lint/commits/systems/netlify_ci.rb
297
303
  - lib/git/lint/configuration/contract.rb
298
304
  - lib/git/lint/configuration/defaults.yml
299
305
  - lib/git/lint/configuration/model.rb
306
+ - lib/git/lint/configuration/trailer.rb
300
307
  - lib/git/lint/container.rb
301
308
  - lib/git/lint/errors/base.rb
302
309
  - lib/git/lint/errors/severity.rb
@@ -313,6 +320,7 @@ files:
313
320
  - lib/git/lint/validators/capitalization.rb
314
321
  - lib/git/lint/validators/email.rb
315
322
  - lib/git/lint/validators/name.rb
323
+ - lib/git/lint/validators/repeated_word.rb
316
324
  homepage: https://alchemists.io/projects/git-lint
317
325
  licenses:
318
326
  - Hippocratic-2.1
@@ -330,10 +338,7 @@ require_paths:
330
338
  - lib
331
339
  required_ruby_version: !ruby/object:Gem::Requirement
332
340
  requirements:
333
- - - ">="
334
- - !ruby/object:Gem::Version
335
- version: '3.2'
336
- - - "<="
341
+ - - "~>"
337
342
  - !ruby/object:Gem::Version
338
343
  version: '3.3'
339
344
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -342,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
342
347
  - !ruby/object:Gem::Version
343
348
  version: '0'
344
349
  requirements: []
345
- rubygems_version: 3.4.22
350
+ rubygems_version: 3.5.3
346
351
  signing_key:
347
352
  specification_version: 4
348
353
  summary: A command line interface for linting Git commits.
metadata.gz.sig CHANGED
Binary file
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Git
4
- module Lint
5
- module Analyzers
6
- # Analyzes commit body for correct bullet point syntax.
7
- class CommitBodyBullet < Abstract
8
- def valid? = commit.body_lines.all? { |line| !invalid_line? line }
9
-
10
- def issue
11
- return {} if valid?
12
-
13
- {
14
- hint: %(Avoid: #{filter_list.to_hint}.),
15
- lines: affected_commit_body_lines
16
- }
17
- end
18
-
19
- protected
20
-
21
- def load_filter_list
22
- Kit::FilterList.new configuration.commits_body_bullet_excludes
23
- end
24
-
25
- # :reek:FeatureEnvy
26
- def invalid_line? line
27
- return false if line.strip.empty?
28
-
29
- !line.match?(/\A(?!\s*#{Regexp.union filter_list.to_regexp}\s+).+\Z/)
30
- end
31
- end
32
- end
33
- end
34
- end