Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0c6ce8c6
Commit
0c6ce8c6
authored
Dec 09, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix CommitLinter to allow subjects that start with a capital letter
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
a40ef4fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
lib/gitlab/danger/commit_linter.rb
lib/gitlab/danger/commit_linter.rb
+2
-0
spec/lib/gitlab/danger/commit_linter_spec.rb
spec/lib/gitlab/danger/commit_linter_spec.rb
+3
-3
No files found.
lib/gitlab/danger/commit_linter.rb
View file @
0c6ce8c6
...
...
@@ -180,6 +180,8 @@ module Gitlab
end
def
subject_starts_with_lowercase?
return
false
if
(
'A'
..
'Z'
).
cover?
(
subject
[
0
])
first_char
=
subject
.
sub
(
/\A(\[.+\]|\w+:)\s/
,
''
)[
0
]
first_char_downcased
=
first_char
.
downcase
return
true
unless
(
'a'
..
'z'
).
cover?
(
first_char_downcased
)
...
...
spec/lib/gitlab/danger/commit_linter_spec.rb
View file @
0c6ce8c6
...
...
@@ -192,7 +192,9 @@ RSpec.describe Gitlab::Danger::CommitLinter do
'[Ci skip] A commit message'
,
'[API] A commit message'
,
'api: A commit message'
,
'API: A commit message'
'API: A commit message'
,
'API: a commit message'
,
'API: a commit message'
].
each
do
|
message
|
context
"when subject is '
#{
message
}
'"
do
let
(
:commit_message
)
{
message
}
...
...
@@ -209,8 +211,6 @@ RSpec.describe Gitlab::Danger::CommitLinter do
'[ci skip]A commit message'
,
'[Ci skip] A commit message'
,
'[ci skip] a commit message'
,
'API: a commit message'
,
'API: a commit message'
,
'api: a commit message'
,
'! A commit message'
].
each
do
|
message
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment