豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

Commit 4462117

Browse files
committed
Capitalize first letter of PR titles by default in TitleBuilder
1 parent 4bc2e11 commit 4462117

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

common/lib/dependabot/pull_request_creator/message_builder/title_builder.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def prefix
7777
def capitalize?
7878
return T.must(prefixer).capitalize_first_word? if prefixer
7979

80-
false
80+
true
8181
end
8282

8383
# Builds prefix from explicit commit_message_options only.

common/spec/dependabot/pull_request_creator/message_builder/title_builder_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
described_class.new(base_title: "bump lodash from 4.0.0 to 5.0.0")
2525
end
2626

27-
it "returns the base title unchanged" do
28-
expect(builder.build).to eq("bump lodash from 4.0.0 to 5.0.0")
27+
it "capitalizes the first letter by default" do
28+
expect(builder.build).to eq("Bump lodash from 4.0.0 to 5.0.0")
2929
end
3030
end
3131

@@ -52,7 +52,7 @@
5252
end
5353

5454
it "applies the prefix" do
55-
expect(builder.build).to eq("[ci]: bump lodash from 4.0.0 to 5.0.0")
55+
expect(builder.build).to eq("[ci]: Bump lodash from 4.0.0 to 5.0.0")
5656
end
5757
end
5858

@@ -79,7 +79,7 @@
7979
end
8080

8181
it "does not double-space" do
82-
expect(builder.build).to eq("[ci] bump lodash from 4.0.0 to 5.0.0")
82+
expect(builder.build).to eq("[ci] Bump lodash from 4.0.0 to 5.0.0")
8383
end
8484
end
8585

@@ -116,7 +116,7 @@
116116
end
117117

118118
it "includes scope in the prefix" do
119-
expect(builder.build).to eq("chore(deps): bump lodash from 4.0.0 to 5.0.0")
119+
expect(builder.build).to eq("chore(deps): Bump lodash from 4.0.0 to 5.0.0")
120120
end
121121
end
122122

@@ -153,7 +153,7 @@
153153
end
154154

155155
it "uses the development prefix" do
156-
expect(builder.build).to eq("chore: bump eslint from 7.0.0 to 8.0.0")
156+
expect(builder.build).to eq("chore: Bump eslint from 7.0.0 to 8.0.0")
157157
end
158158
end
159159

@@ -198,8 +198,8 @@
198198
]
199199
end
200200

201-
it "returns the base title without prefix" do
202-
expect(builder.build).to eq("bump lodash from 4.0.0 to 5.0.0")
201+
it "capitalizes the base title without prefix" do
202+
expect(builder.build).to eq("Bump lodash from 4.0.0 to 5.0.0")
203203
end
204204
end
205205
end

0 commit comments

Comments
 (0)