commit_format 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/commit_format/formatter.rb +3 -2
- data/lib/commit_format/version.rb +1 -1
- data/spec/lib/commit_format/cli_spec.rb +31 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6841477fd9879e1b5b5064bad1181090da3f64ff209cb8972b7831dfd9d4c084
|
4
|
+
data.tar.gz: 5aaa3c39ec85dac873a052639ed5651fbdae2b165bfb6790f0738b3c0d9bc829
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56b78c358da12ba3e1157a6e5e3c3a0f9a4c6f4ed69e4d210fd415e6575f7726aee2b9d0e7f9514230b59464c9b437acdec55b0a851bfae1ac201d358e81e129
|
7
|
+
data.tar.gz: aa1e1f983f333951871d861f541f8808f07da8e0f491028819e740bc0b7df97c98752c4d97c06a6760ed4d2a6f2f7b1e3f02da7cd3239c18ac3df2fd22a7074d
|
data/CHANGELOG.md
CHANGED
@@ -122,14 +122,15 @@ module CommitFormat
|
|
122
122
|
HEADING_LINE_CHARS.include?(uniq_chars.first)
|
123
123
|
end
|
124
124
|
|
125
|
-
def fixed_line?(string)
|
125
|
+
def fixed_line?(string) # rubocop:disable Metrics/CyclomaticComplexity
|
126
126
|
string.start_with?(" ") || # Indented line
|
127
127
|
string.start_with?("\t") || # Indented line
|
128
128
|
string.start_with?("- ") || # Unordered list item
|
129
129
|
string.start_with?("* ") || # Unordered list item
|
130
130
|
string.start_with?("|") || # Table
|
131
131
|
string.start_with?("> ") || # Blockquote
|
132
|
-
string.start_with?(/\d+\. /) # Numbered list item
|
132
|
+
string.start_with?(/\d+\. /) || # Numbered list item
|
133
|
+
string.start_with?(/\[[^\]]+\]:\s.+/) # Link reference
|
133
134
|
end
|
134
135
|
|
135
136
|
def clear_paragraph!
|
@@ -256,6 +256,37 @@ RSpec.describe CommitFormat::Cli do
|
|
256
256
|
OUTPUT
|
257
257
|
end
|
258
258
|
|
259
|
+
it "keeps link reference formatting" do
|
260
|
+
test_dir = "paragraph_flag_link_references"
|
261
|
+
prepare_repository test_dir do
|
262
|
+
create_commit "Commit subject 1", "Commit message body.\nSecond line."
|
263
|
+
checkout_branch "my-branch"
|
264
|
+
create_commit "Commit subject 2",
|
265
|
+
<<~MESSAGE
|
266
|
+
Commit message body.
|
267
|
+
[Link label](http://localhost:3000/path1) extra part.
|
268
|
+
Third line.
|
269
|
+
|
270
|
+
[Link name 1]: http://localhost:3000/path1
|
271
|
+
[Link name 2]: http://localhost:3000/path2
|
272
|
+
|
273
|
+
Footer
|
274
|
+
MESSAGE
|
275
|
+
end
|
276
|
+
|
277
|
+
output = run(test_dir, ["--paragraph"])
|
278
|
+
expect(output).to eql(<<~OUTPUT)
|
279
|
+
## Commit subject 2
|
280
|
+
|
281
|
+
Commit message body. [Link label](http://localhost:3000/path1) extra part. Third line.
|
282
|
+
|
283
|
+
[Link name 1]: http://localhost:3000/path1
|
284
|
+
[Link name 2]: http://localhost:3000/path2
|
285
|
+
|
286
|
+
Footer
|
287
|
+
OUTPUT
|
288
|
+
end
|
289
|
+
|
259
290
|
it "keeps tables formatting" do
|
260
291
|
test_dir = "paragraph_flag_tables"
|
261
292
|
prepare_repository test_dir do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commit_format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom de Bruijn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: debug
|