commitlint 0.1.2 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: beb9222a30c59f04253201f33eb84c7f8ee60013984818a0f80a1de39233923c
4
- data.tar.gz: e1fab142a743b5b3061d1ea27ad2078f9e10e4bc36b02734885a2d74735dc727
3
+ metadata.gz: 02cd12360119f61d1a20de560bd95372c53de4b84ba6c6138b4c5be85c60d37e
4
+ data.tar.gz: 991fbd28f441eeac31cf6b16865c7a11e704ae3d324c298b0d9bd5c1c175b93d
5
5
  SHA512:
6
- metadata.gz: 6f1b74fde8eca4b39a03d3d590b47f86cb5741db1656fa10b34acc3f85ac94e652bb40e253a380d3bfb5b14ac5231c9b8837379cd17056d6e1eb2b9d7d4fc1b9
7
- data.tar.gz: ed107ccf7e39a16b653a8bcd25faae353192de384f5123f92a053f028e6150cc16f3e4953cdd311dd2cf862aae6b1546a8689e7974a87a726454067c692d8304
6
+ metadata.gz: 9c05c8a71b7db6ad90b96e3f98df295fc4c802f517b6303c7cc3ae08d6bddeb83dd2ae1a4c90c6d88a8d3786e988938df80763ecf93d3cb1263088426c5b0360
7
+ data.tar.gz: 23a3f39618cc7af53352a8e8655984708ab2aee0b39abb4278d7bef8b544538d8d982b1880ae240bfb0a03b825367c0a7dc14b7079924cc386d3a2d26af43fe4
@@ -11,22 +11,30 @@ module Commitlint
11
11
  def lint!
12
12
  validator = Validator.new(@commit_message)
13
13
 
14
- return 0 if validator.valid?
14
+ if validator.valid?
15
+ puts "Everything is look good!" if @output
16
+
17
+ return 0
18
+ end
15
19
 
16
20
  errors = validator.errors
17
21
 
18
- puts <<~MESSAGE if @output
22
+ puts parse_errors(errors) if @output
23
+ 1
24
+ end
25
+
26
+ private
27
+
28
+ def parse_errors(errors)
29
+ <<~MESSAGE
19
30
  \nYour commit message is invalid:
20
31
 
21
32
  #{errors.map { |e| "=> #{e}" }.join("\n")}
22
33
 
23
34
  Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint\n
24
35
  MESSAGE
25
- 1
26
36
  end
27
37
 
28
- private
29
-
30
38
  def clean_commit_message(message)
31
39
  message.strip.gsub(/#.*$/, "").strip
32
40
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Commitlint
4
- VERSION = "0.1.2"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: commitlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arandi Lopez
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-05-07 00:00:00.000000000 Z
10
+ date: 2025-05-09 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: optparse
@@ -52,7 +51,6 @@ licenses:
52
51
  metadata:
53
52
  homepage_uri: https://github.com/arandilopez/commitlint
54
53
  source_code_uri: https://github.com/arandilopez/commitlint
55
- post_install_message:
56
54
  rdoc_options: []
57
55
  require_paths:
58
56
  - lib
@@ -67,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
65
  - !ruby/object:Gem::Version
68
66
  version: '0'
69
67
  requirements: []
70
- rubygems_version: 3.4.12
71
- signing_key:
68
+ rubygems_version: 3.6.4
72
69
  specification_version: 4
73
70
  summary: Conventional commint linter for Ruby projects
74
71
  test_files: []