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
d004e07b
Commit
d004e07b
authored
Oct 29, 2020
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
danger: Allow section prefix in commit messages
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
5b14c527
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
lib/gitlab/danger/commit_linter.rb
lib/gitlab/danger/commit_linter.rb
+1
-1
spec/lib/gitlab/danger/commit_linter_spec.rb
spec/lib/gitlab/danger/commit_linter_spec.rb
+6
-1
No files found.
lib/gitlab/danger/commit_linter.rb
View file @
d004e07b
...
...
@@ -191,7 +191,7 @@ module Gitlab
end
def
subject_starts_with_lowercase?
first_char
=
subject
.
sub
(
/\A
\[.+\]
\s/
,
''
)[
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 @
d004e07b
...
...
@@ -190,7 +190,9 @@ RSpec.describe Gitlab::Danger::CommitLinter do
[
'[ci skip] A commit message'
,
'[Ci skip] 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
}
...
...
@@ -207,6 +209,9 @@ 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
|
context
"when subject is '
#{
message
}
'"
do
...
...
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