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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
193f764b
Commit
193f764b
authored
Jan 11, 2019
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shorten danger 50 char commit warning
- Also pulls URLs into vars
parent
89c4d2ae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
danger/commit_messages/Dangerfile
danger/commit_messages/Dangerfile
+5
-5
No files found.
danger/commit_messages/Dangerfile
View file @
193f764b
...
@@ -14,6 +14,9 @@ class EmojiChecker
...
@@ -14,6 +14,9 @@ class EmojiChecker
DIGESTS
=
File
.
expand_path
(
'../../fixtures/emojis/digests.json'
,
__dir__
)
DIGESTS
=
File
.
expand_path
(
'../../fixtures/emojis/digests.json'
,
__dir__
)
ALIASES
=
File
.
expand_path
(
'../../fixtures/emojis/aliases.json'
,
__dir__
)
ALIASES
=
File
.
expand_path
(
'../../fixtures/emojis/aliases.json'
,
__dir__
)
URL_LIMIT_SUBJECT
=
"https://chris.beams.io/posts/git-commit/#limit-50"
URL_GIT_COMMIT
=
"https://chris.beams.io/posts/git-commit/"
# A regex that indicates a piece of text _might_ include an Emoji. The regex
# A regex that indicates a piece of text _might_ include an Emoji. The regex
# alone is not enough, as we'd match `:foo:bar:baz`. Instead, we use this
# alone is not enough, as we'd match `:foo:bar:baz`. Instead, we use this
# regex to save us from having to check for all possible emoji names when we
# regex to save us from having to check for all possible emoji names when we
...
@@ -101,10 +104,7 @@ def lint_commits(commits)
...
@@ -101,10 +104,7 @@ def lint_commits(commits)
elsif
subject
.
length
>
50
elsif
subject
.
length
>
50
warn_commit
(
warn_commit
(
commit
,
commit
,
"This commit's subject line could be improved. "
\
"This commit's subject line is acceptable, but please try to [reduce it to 50 characters](
#{
URL_LIMIT_SUBJECT
}
)."
'Commit subjects are ideally no longer than roughly 50 characters, '
\
'though we allow up to 72 characters in the subject. '
\
'If possible, try to reduce the length of the subject to roughly 50 characters.'
)
)
end
end
...
@@ -196,7 +196,7 @@ def lint_commits(commits)
...
@@ -196,7 +196,7 @@ def lint_commits(commits)
One or more commit messages do not meet our Git commit message standards.
One or more commit messages do not meet our Git commit message standards.
For more information on how to write a good commit message, take a look at
For more information on how to write a good commit message, take a look at
[How to Write a Git Commit Message](
https://chris.beams.io/posts/git-commit/
).
[How to Write a Git Commit Message](
#{
URL_GIT_COMMIT
}
).
Here is an example of a good commit message:
Here is an example of a good commit 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