Skip to content
Snippets Groups Projects
Commit aa671ba5 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Tweak Danger to better detect changelog trailers

This makes the regex more strict, and changed the lint_commit method
name to what's being used in gitlab-org/gitlab.

See https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/5173#note_558858405
for more information.
parent 420232b9
No related branches found
No related tags found
2 merge requests!51Validate shift of Heptapod 0.25 to oldstable series,!41GitLab 13.12
......@@ -2,8 +2,8 @@
require 'yaml'
def lint_commit(commit)
trailer = commit.message.match(/^Changelog:\s*(?<category>\w+)/)
def check_changelog_trailer(commit)
trailer = commit.message.match(/^Changelog:\s*(?<category>.+)$/)
return :missing if trailer.nil? || trailer[:category].nil?
......@@ -73,7 +73,7 @@
checked = 0
git.commits.each do |commit|
case lint_commit(commit)
case check_changelog_trailer(commit)
when :valid, :invalid
checked += 1
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment