git-lint 5.0.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3955d8d2f1ec24fd3501d952c62d3639f96fa5e417ef56ca0fe48269048c8ba1
4
- data.tar.gz: b02899b30de349bab2a672de98ab06ce4155c500781fb6274adc512afb3ef9a0
3
+ metadata.gz: ee879ef7d2e54043b42c8c608a6bcf57869fe7593c65d797f5897dea3208cf18
4
+ data.tar.gz: 5aa959f0942970ce6881839d5a9c8d419faaf43bcdd5a0a5feb8e94cd71654f1
5
5
  SHA512:
6
- metadata.gz: 521674b30c53b1ebefa82ed270e685280c69ae9b25ca323cc79658a7b308fb8edf6940d957760bffd7d8a39092e6648b828f12721de2a1ab41477684338fac7e
7
- data.tar.gz: 422413f4a60e9f3a2079578c4d01f0e8fb6d76f3b4958f10704f5d2f87728251908fbf8a53a82109a899069fe2d446c6d359eb174c35f55057b0a8cea377a16f
6
+ metadata.gz: '08255c0ed8001b3ebbefb067ccaa94a9319c24146d45c9a39fa9394129e7f72d38c8c5b7df300a5b88e2ffc90f37ed55aba727e07e07e0b8fc1d287caa9313b7'
7
+ data.tar.gz: 6e77fd97e3aea400d72072aa35b739760027259913776b54a5b4822b4f836f0d2b7d47a0b2510e0a80a415efe599302bea3f548db0c9d97776a247f51177fd89
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -1191,7 +1191,7 @@ To test, run:
1191
1191
 
1192
1192
  [source,bash]
1193
1193
  ----
1194
- bundle exec rake
1194
+ bin/rake
1195
1195
  ----
1196
1196
 
1197
1197
  == link:https://www.alchemists.io/policies/license[License]
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.0.0"
5
+ spec.version = "5.1.1"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://www.alchemists.io/projects/git-lint"
@@ -24,9 +24,10 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.required_ruby_version = "~> 3.2"
26
26
  spec.add_dependency "cogger", "~> 0.5"
27
+ spec.add_dependency "core", "~> 0.1.0"
27
28
  spec.add_dependency "dry-container", "~> 0.11"
28
29
  spec.add_dependency "dry-monads", "~> 1.6"
29
- spec.add_dependency "gitt", "~> 1.0"
30
+ spec.add_dependency "gitt", "~> 1.1"
30
31
  spec.add_dependency "infusible", "~> 1.0"
31
32
  spec.add_dependency "pastel", "~> 0.8"
32
33
  spec.add_dependency "refinements", "~> 10.0"
@@ -42,11 +42,13 @@ module Git
42
42
  ].freeze
43
43
 
44
44
  # rubocop:disable Metrics/ParameterLists
45
- def initialize analyzers: ANALYZERS,
46
- collector: Collector.new,
47
- reporter: Reporters::Branch,
48
- **dependencies
49
- super(**dependencies)
45
+ def initialize(
46
+ analyzers: ANALYZERS,
47
+ collector: Collector.new,
48
+ reporter: Reporters::Branch,
49
+ **
50
+ )
51
+ super(**)
50
52
  @analyzers = analyzers
51
53
  @collector = collector
52
54
  @reporter = reporter
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
3
4
  require "refinements/strings"
4
5
 
5
6
  module Git
@@ -22,8 +23,8 @@ module Git
22
23
 
23
24
  attr_reader :commit
24
25
 
25
- def initialize commit, **dependencies
26
- super(**dependencies)
26
+ def initialize(commit, **)
27
+ super(**)
27
28
  @commit = commit
28
29
  @filter_list = load_filter_list
29
30
  end
@@ -54,7 +55,7 @@ module Git
54
55
 
55
56
  attr_reader :filter_list
56
57
 
57
- def load_filter_list = []
58
+ def load_filter_list = Core::EMPTY_ARRAY
58
59
 
59
60
  def affected_commit_body_lines
60
61
  commit.body_lines.each.with_object([]).with_index do |(line, lines), index|
@@ -5,7 +5,7 @@ module Git
5
5
  module Analyzers
6
6
  # Analyzes commit body for proper capitalization of bullet sentences.
7
7
  class CommitBodyBulletCapitalization < Abstract
8
- def valid? = lowercased_bullets.size.zero?
8
+ def valid? = lowercased_bullets.empty?
9
9
 
10
10
  def issue
11
11
  return {} if valid?
@@ -9,8 +9,8 @@ module Git
9
9
  class Branch
10
10
  include Git::Lint::Import[:kernel, :logger]
11
11
 
12
- def initialize analyzer: Analyzer.new, **dependencies
13
- super(**dependencies)
12
+ def initialize(analyzer: Analyzer.new, **)
13
+ super(**)
14
14
  @analyzer = analyzer
15
15
  end
16
16
 
@@ -9,8 +9,8 @@ module Git
9
9
  class Commit
10
10
  include Git::Lint::Import[:git, :kernel, :logger]
11
11
 
12
- def initialize analyzer: Analyzer.new, **dependencies
13
- super(**dependencies)
12
+ def initialize(analyzer: Analyzer.new, **)
13
+ super(**)
14
14
  @analyzer = analyzer
15
15
  end
16
16
 
@@ -8,8 +8,8 @@ module Git
8
8
  class Config
9
9
  include Git::Lint::Import[:kernel, :logger]
10
10
 
11
- def initialize configuration: Configuration::Loader::CLIENT, **dependencies
12
- super(**dependencies)
11
+ def initialize(configuration: Configuration::Loader::CLIENT, **)
12
+ super(**)
13
13
  @configuration = configuration
14
14
  end
15
15
 
@@ -8,8 +8,8 @@ module Git
8
8
  class Hook
9
9
  include Git::Lint::Import[:git, :kernel, :logger]
10
10
 
11
- def initialize analyzer: Analyzer.new, **dependencies
12
- super(**dependencies)
11
+ def initialize(analyzer: Analyzer.new, **)
12
+ super(**)
13
13
  @analyzer = analyzer
14
14
  end
15
15
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
3
4
  require "optparse"
4
5
 
5
6
  module Git
@@ -12,14 +13,14 @@ module Git
12
13
  CLIENT = OptionParser.new nil, 40, " "
13
14
  SECTIONS = [Parsers::Core, Parsers::Analyze].freeze # Order matters.
14
15
 
15
- def initialize sections: SECTIONS, client: CLIENT, **dependencies
16
- super(**dependencies)
16
+ def initialize(sections: SECTIONS, client: CLIENT, **)
17
+ super(**)
17
18
  @sections = sections
18
19
  @client = client
19
20
  @configuration_duplicate = configuration.dup
20
21
  end
21
22
 
22
- def call arguments = []
23
+ def call arguments = Core::EMPTY_ARRAY
23
24
  sections.each { |section| section.call configuration_duplicate, client: }
24
25
  client.parse arguments
25
26
  configuration_duplicate.freeze
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
3
4
  require "refinements/structs"
4
5
 
5
6
  module Git
@@ -17,7 +18,7 @@ module Git
17
18
  @client = client
18
19
  end
19
20
 
20
- def call arguments = []
21
+ def call arguments = ::Core::EMPTY_ARRAY
21
22
  client.separator "\nANALYZE OPTIONS:\n"
22
23
  add_sha
23
24
  client.parse arguments
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
3
4
  require "refinements/structs"
4
5
 
5
6
  module Git
@@ -14,15 +15,13 @@ module Git
14
15
 
15
16
  def self.call(...) = new(...).call
16
17
 
17
- def initialize configuration = Container[:configuration],
18
- client: Parser::CLIENT,
19
- **dependencies
20
- super(**dependencies)
18
+ def initialize(configuration = Container[:configuration], client: Parser::CLIENT, **)
19
+ super(**)
21
20
  @configuration = configuration
22
21
  @client = client
23
22
  end
24
23
 
25
- def call arguments = []
24
+ def call arguments = ::Core::EMPTY_ARRAY
26
25
  client.banner = specification.labeled_summary
27
26
  client.separator "\nUSAGE:\n"
28
27
  collate
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
4
+
3
5
  module Git
4
6
  module Lint
5
7
  module CLI
@@ -14,13 +16,13 @@ module Git
14
16
  :logger
15
17
  ]
16
18
 
17
- def initialize parser: Parser.new, **dependencies
18
- super(**dependencies)
19
+ def initialize(parser: Parser.new, **)
20
+ super(**)
19
21
  @parser = parser
20
22
  end
21
23
 
22
- def call arguments = []
23
- perform parser.call(arguments)
24
+ def call arguments = Core::EMPTY_ARRAY
25
+ act_on parser.call(arguments)
24
26
  rescue OptionParser::ParseError, Errors::Base => error
25
27
  logger.error { error.message }
26
28
  end
@@ -29,7 +31,7 @@ module Git
29
31
 
30
32
  attr_reader :parser
31
33
 
32
- def perform configuration
34
+ def act_on configuration
33
35
  case configuration
34
36
  in action_analyze: true, analyze_sha: nil then analyze_branch.call
35
37
  in action_analyze: true, analyze_sha: String => sha then analyze_commit.call sha
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
4
+
3
5
  module Git
4
6
  module Lint
5
7
  module Kit
6
8
  # Represents an regular expression list which may be used as an analyzer setting.
7
9
  class FilterList
8
- def initialize list = []
10
+ def initialize list = Core::EMPTY_ARRAY
9
11
  @list = Array list
10
12
  end
11
13
 
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
4
+
3
5
  module Git
4
6
  module Lint
5
7
  module Reporters
@@ -7,7 +9,7 @@ module Git
7
9
  class Line
8
10
  DEFAULT_INDENT = " "
9
11
 
10
- def initialize data = {}
12
+ def initialize data = Core::EMPTY_HASH
11
13
  @data = data
12
14
  end
13
15
 
@@ -1,12 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
4
+
3
5
  module Git
4
6
  module Lint
5
7
  module Reporters
6
8
  module Lines
7
9
  # Reports paragraph details.
8
10
  class Paragraph
9
- def initialize data = {}
11
+ def initialize data = Core::EMPTY_HASH
10
12
  @data = data
11
13
  end
12
14
 
@@ -1,12 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
4
+
3
5
  module Git
4
6
  module Lint
5
7
  module Reporters
6
8
  module Lines
7
9
  # Reports sentence details.
8
10
  class Sentence
9
- def initialize data = {}
11
+ def initialize data = Core::EMPTY_HASH
10
12
  @data = data
11
13
  end
12
14
 
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: 5.0.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
29
29
  RFE=
30
30
  -----END CERTIFICATE-----
31
- date: 2022-12-27 00:00:00.000000000 Z
31
+ date: 2023-02-05 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: cogger
@@ -44,6 +44,20 @@ dependencies:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0.5'
47
+ - !ruby/object:Gem::Dependency
48
+ name: core
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: 0.1.0
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: 0.1.0
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: dry-container
49
63
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +92,14 @@ dependencies:
78
92
  requirements:
79
93
  - - "~>"
80
94
  - !ruby/object:Gem::Version
81
- version: '1.0'
95
+ version: '1.1'
82
96
  type: :runtime
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
100
  - - "~>"
87
101
  - !ruby/object:Gem::Version
88
- version: '1.0'
102
+ version: '1.1'
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: infusible
91
105
  requirement: !ruby/object:Gem::Requirement
@@ -283,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
297
  - !ruby/object:Gem::Version
284
298
  version: '0'
285
299
  requirements: []
286
- rubygems_version: 3.4.1
300
+ rubygems_version: 3.4.6
287
301
  signing_key:
288
302
  specification_version: 4
289
303
  summary: A command line interface for linting Git commits.
metadata.gz.sig CHANGED
Binary file