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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68d7c9f7d1e0c01f028da842d66ccce4fb35b24e867cd6a813d31d6bf2146503
4
- data.tar.gz: 901660bfa3f3794ae6f58a7d17f552a2e5e07386dbd5cf9ba9c425b60d77a83c
3
+ metadata.gz: 6841477fd9879e1b5b5064bad1181090da3f64ff209cb8972b7831dfd9d4c084
4
+ data.tar.gz: 5aaa3c39ec85dac873a052639ed5651fbdae2b165bfb6790f0738b3c0d9bc829
5
5
  SHA512:
6
- metadata.gz: b142b8f0a27079b93a7a2c8621a755d948120d06099bc3c1f514a157633bd6eabedc66751b67d205bf3761899d61b042461497c22169e0178a930c79a9404dc0
7
- data.tar.gz: c2aaa0b482a4e97c6741a8d9f12b5ca779d3b26c135f4f7a2352d9c1f4cc07997157102a6eae1c63d77ff786e116513b9c39017fab6aa750b99d87d9e755c068
6
+ metadata.gz: 56b78c358da12ba3e1157a6e5e3c3a0f9a4c6f4ed69e4d210fd415e6575f7726aee2b9d0e7f9514230b59464c9b437acdec55b0a851bfae1ac201d358e81e129
7
+ data.tar.gz: aa1e1f983f333951871d861f541f8808f07da8e0f491028819e740bc0b7df97c98752c4d97c06a6760ed4d2a6f2f7b1e3f02da7cd3239c18ac3df2fd22a7074d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Commit Format
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Fixed
6
+
7
+ - [bd1a3d5](https://github.com/tombruijn/commit-format/commit/bd1a3d5a7466cf8c18634474d009021c034d9b15) patch - Paragraph flag doesn't join link references on multiple lines.
8
+
3
9
  ## 0.2.0
4
10
 
5
11
  ### Added
@@ -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!
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CommitFormat
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
@@ -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.0
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-09-29 00:00:00.000000000 Z
11
+ date: 2022-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug