commitlint 0.1.2 → 0.3.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/linter.rb +13 -5
- data/lib/commitlint/version.rb +1 -1
- data/lib/commitlint.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: a25a995af22b8a516121c8b511c3302789012b8ca467a0ece9e0b380b1f20b37
|
4
|
+
data.tar.gz: 7d353d7bd4bb44271fb65051af4930650f4bb19f6e3279e683200f6820c2e511
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e4eb0a4509e45b9aea29f1135ca1c492798247f344ab53186e5ecbc10a10abfef6116554c1a7ed7565645735b364f5e2e1d03cd68f0a0ee03a36a9857650ad9
|
7
|
+
data.tar.gz: a69470bd4b4fdc450f579faf7fb153afcc408c325771491604f7bd0d45f4265c0b0d75842402bb7ebb4adaa0c29aabafa46177606e31b0fce2b63980a5ead13f
|
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
data/lib/commitlint.rb
CHANGED
@@ -8,7 +8,7 @@ require_relative "commitlint/cli"
|
|
8
8
|
module Commitlint
|
9
9
|
class Error < StandardError; end
|
10
10
|
|
11
|
-
VALID_TYPES = %w[feat fix docs style refactor perf test chore revert].freeze
|
11
|
+
VALID_TYPES = %w[feat fix docs style refactor perf test chore revert deps].freeze
|
12
12
|
CONVENTIONAL_COMMIT_SCHEMA = /(?x)
|
13
13
|
^(?<type>#{VALID_TYPES.join("|")}) # Type
|
14
14
|
(\((?<scope>.*?)\))? # Optional scope
|
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.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arandi Lopez
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 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.
|
71
|
-
signing_key:
|
68
|
+
rubygems_version: 3.7.1
|
72
69
|
specification_version: 4
|
73
70
|
summary: Conventional commint linter for Ruby projects
|
74
71
|
test_files: []
|