commitlint 0.1.1 → 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 +4 -4
- data/lib/commitlint/cli.rb +1 -1
- data/lib/commitlint/linter.rb +13 -5
- data/lib/commitlint/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02cd12360119f61d1a20de560bd95372c53de4b84ba6c6138b4c5be85c60d37e
|
4
|
+
data.tar.gz: 991fbd28f441eeac31cf6b16865c7a11e704ae3d324c298b0d9bd5c1c175b93d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c05c8a71b7db6ad90b96e3f98df295fc4c802f517b6303c7cc3ae08d6bddeb83dd2ae1a4c90c6d88a8d3786e988938df80763ecf93d3cb1263088426c5b0360
|
7
|
+
data.tar.gz: 23a3f39618cc7af53352a8e8655984708ab2aee0b39abb4278d7bef8b544538d8d982b1880ae240bfb0a03b825367c0a7dc14b7079924cc386d3a2d26af43fe4
|
data/lib/commitlint/cli.rb
CHANGED
@@ -51,7 +51,7 @@ module Commitlint
|
|
51
51
|
@options[:message] = message.nil? ? ".git/COMMIT_EDITMSG" : message
|
52
52
|
end
|
53
53
|
|
54
|
-
opts.on("-q", "--
|
54
|
+
opts.on("-q", "--quiet", "Suppress output") { @options[:quiet] = true }
|
55
55
|
opts.on("-h", "--help", "Show this help message") { puts opts }
|
56
56
|
opts.on("-v", "--version", "Show version") { puts Commitlint::VERSION }
|
57
57
|
end
|
data/lib/commitlint/linter.rb
CHANGED
@@ -11,22 +11,30 @@ module Commitlint
|
|
11
11
|
def lint!
|
12
12
|
validator = Validator.new(@commit_message)
|
13
13
|
|
14
|
-
|
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
|
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
|
data/lib/commitlint/version.rb
CHANGED
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.
|
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-
|
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
|
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: []
|