conventional_commits 0.2.4 → 0.2.6
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/Gemfile.lock +1 -1
- data/lib/branch/branch_name_generator.rb +6 -2
- data/lib/commit/commit_message_generator.rb +5 -1
- data/lib/conventional_commits/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfcf1509b4e79d3f242ea269bceeee592525b966c03da4e80e81c8e61f77a8a4
|
4
|
+
data.tar.gz: 28330e916294316cfc5816134aca2b964d6b0285236d6edccfdac11ba856ade9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 792c7f55a212ba698366687aea46555d93cb231895d540de2e8d6b0749f1abe9d21872e803a1a4619542fd63849a1a8d9e20331de057313c7c7c41992de6a2dc
|
7
|
+
data.tar.gz: 845fefdafa1e57c5efb15505d869618b23080ad72eefe4f32108854eb44e4d20159fb6db12805cb1e3d0f977a97b02f57a9bfae29db28cf9173ee7fbe73b9230
|
data/Gemfile.lock
CHANGED
@@ -27,7 +27,7 @@ module ConventionalCommits
|
|
27
27
|
scope_is_included = out.length == Configuration::MAX_ELEMENTS_IN_PATTERN
|
28
28
|
idx_adj = scope_is_included ? 1 : 0
|
29
29
|
components = { scope: nil, type: nil, ticket_number: nil, description: nil }
|
30
|
-
components[:scope] = out.length == Configuration::MAX_ELEMENTS_IN_PATTERN ? out[0] : nil
|
30
|
+
components[:scope] = out.length == Configuration::MAX_ELEMENTS_IN_PATTERN ? sanitize(out[0]) : nil
|
31
31
|
components[:type] = out[0 + idx_adj]
|
32
32
|
components[:ticket_number] = out[1 + idx_adj]
|
33
33
|
components[:description] = out[2 + idx_adj]
|
@@ -56,7 +56,7 @@ module ConventionalCommits
|
|
56
56
|
delimiters = find_delimiters_from_pattern(pattern:)
|
57
57
|
out = split_name_using_delimiters(delimiters, input)
|
58
58
|
if delimiters.length > out.length && pattern.include?("<scope>")
|
59
|
-
components_using(input, pattern.gsub(%r{<scope>/}, ""))
|
59
|
+
out = components_using(input, pattern.gsub(%r{<scope>/}, ""))
|
60
60
|
elsif delimiters.length > out.length
|
61
61
|
raise ConventionalCommits::GenericError,
|
62
62
|
"The branch doesnt respect the template, expect at least #{delimiters.length} delimiters. Received: #{out}".strip
|
@@ -90,5 +90,9 @@ module ConventionalCommits
|
|
90
90
|
raise(GenericError,
|
91
91
|
"Doesnt match the pattern expect at least #{delimiters.length + 1} words")
|
92
92
|
end
|
93
|
+
|
94
|
+
def sanitize(string)
|
95
|
+
string.gsub(/-/, " ").gsub(/_/, " ")
|
96
|
+
end
|
93
97
|
end
|
94
98
|
end
|
@@ -12,7 +12,7 @@ module ConventionalCommits
|
|
12
12
|
type = (components[:type] || "").downcase
|
13
13
|
ticket_number = components[:ticket_number] || ""
|
14
14
|
description = components[:description] || ""
|
15
|
-
description = description
|
15
|
+
description = sanitize(description)
|
16
16
|
|
17
17
|
unless main_config.type.is_allowed(type)
|
18
18
|
raise ConventionalCommits::GenericError,
|
@@ -49,5 +49,9 @@ module ConventionalCommits
|
|
49
49
|
def skippable_sources
|
50
50
|
%w[message merge squash]
|
51
51
|
end
|
52
|
+
|
53
|
+
def sanitize(string)
|
54
|
+
string.gsub(/-/, " ").gsub(/_/, " ")
|
55
|
+
end
|
52
56
|
end
|
53
57
|
end
|