summaryrefslogtreecommitdiff
path: root/danger/gemfile/Dangerfile
blob: 4e91abc371ad83fd11023574bb6a33a9eedd0f2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
GEMFILE_LOCK_NOT_UPDATED_MESSAGE = <<~MSG.freeze
**%<gemfile>s was updated but %<gemfile_lock>s wasn't updated.**

Usually, when %<gemfile>s is updated, you should run
```
bundle install && \
  bundle install
```

or

```
bundle update <the-added-or-updated-gem>
```

and commit the %<gemfile_lock>s changes.
MSG

gemfile_modified = git.modified_files.include?("Gemfile")
gemfile_lock_modified = git.modified_files.include?("Gemfile.lock")

if gemfile_modified && !gemfile_lock_modified
  warn format(GEMFILE_LOCK_NOT_UPDATED_MESSAGE, gemfile: gitlab.html_link("Gemfile"), gemfile_lock: gitlab.html_link("Gemfile.lock"))
end