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
c7cfc1b9
Commit
c7cfc1b9
authored
6 years ago
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
2074dbef
d3c6f9c4
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
128 additions
and
115 deletions
+128
-115
danger/commit_messages/Dangerfile
danger/commit_messages/Dangerfile
+128
-115
No files found.
danger/commit_messages/Dangerfile
View file @
c7cfc1b9
...
@@ -64,11 +64,12 @@ def too_many_changed_lines?(commit)
...
@@ -64,11 +64,12 @@ def too_many_changed_lines?(commit)
lines_changed_in_commit
(
commit
)
>=
30
lines_changed_in_commit
(
commit
)
>=
30
end
end
def
lint_commits
(
commits
)
def
emoji_checker
failures
=
false
@emoji_checker
||=
EmojiChecker
.
new
emoji_checker
=
EmojiChecker
.
new
end
unicode_emoji_regex
=
%r((
def
unicode_emoji_regex
@unicode_emoji_regex
||=
%r((
[
\u
{1F300}-
\u
{1F5FF}] |
[
\u
{1F300}-
\u
{1F5FF}] |
[
\u
{1F1E6}-
\u
{1F1FF}] |
[
\u
{1F1E6}-
\u
{1F1FF}] |
[
\u
{2700}-
\u
{27BF}] |
[
\u
{2700}-
\u
{27BF}] |
...
@@ -77,12 +78,17 @@ def lint_commits(commits)
...
@@ -77,12 +78,17 @@ def lint_commits(commits)
[
\u
{1F680}-
\u
{1F6FF}] |
[
\u
{1F680}-
\u
{1F6FF}] |
[
\u
{2600}-
\u
{26FF}]
[
\u
{2600}-
\u
{26FF}]
))x
))x
end
commits
.
each
do
|
commit
|
def
lint_commit
(
commit
)
# For now we'll ignore merge commits, as getting rid of those is a problem
# For now we'll ignore merge commits, as getting rid of those is a problem
# separate from enforcing good commit messages.
# separate from enforcing good commit messages.
next
if
commit
.
message
.
start_with?
(
'Merge branch'
)
return
false
if
commit
.
message
.
start_with?
(
'Merge branch'
)
# We ignore revert commits as they are well structured by Git already
return
false
if
commit
.
message
.
start_with?
(
'Revert "'
)
failures
=
false
subject
,
separator
,
details
=
commit
.
message
.
split
(
"
\n
"
,
3
)
subject
,
separator
,
details
=
commit
.
message
.
split
(
"
\n
"
,
3
)
if
subject
.
split
.
length
<
3
if
subject
.
split
.
length
<
3
...
@@ -188,9 +194,16 @@ def lint_commits(commits)
...
@@ -188,9 +194,16 @@ def lint_commits(commits)
failures
=
true
failures
=
true
end
end
failures
end
def
lint_commits
(
commits
)
failed
=
commits
.
reject
do
|
commit
|
lint_commit
(
commit
)
end
end
if
fail
ures
if
fail
ed
.
any?
markdown
(
<<~
MARKDOWN
)
markdown
(
<<~
MARKDOWN
)
## Commit message standards
## Commit message standards
...
...
This diff is collapsed.
Click to expand it.
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