gitlab-org--gitlab-foss/danger/gemfile/Dangerfile
Rémy Coutable 5679837cd4
Start to use Danger for automating MR reviews
Signed-off-by: Rémy Coutable <remy@rymai.me>
2018-07-11 11:52:01 +02:00

15 lines
614 B
Ruby

# rubocop:disable Style/SignalException
gemfile_modified = git.modified_files.include?("Gemfile")
gemfile_lock_modified = git.modified_files.include?("Gemfile.lock")
if gemfile_modified && !gemfile_lock_modified
msg = [
"#{gitlab.html_link("Gemfile")} was edited but #{gitlab.html_link("Gemfile.lock")} wasn't.",
"Usually, when #{gitlab.html_link("Gemfile")} is updated, you should run",
"`bundle install && BUNDLE_GEMFILE=Gemfile.rails5 bundle install` or",
"`bundle update <the-added-or-updated-gem>` and commit the #{gitlab.html_link("Gemfile.lock")} changes."
]
warn msg.join(" ")
end