summaryrefslogtreecommitdiff
path: root/danger/documentation
diff options
context:
space:
mode:
authorLukas Eipert <leipert@gitlab.com>2018-10-16 15:56:03 +0200
committerLukas Eipert <leipert@gitlab.com>2018-10-22 11:04:55 +0200
commit253e1818aa3efafb05d9994aab0f778d339e26ac (patch)
treea453ba647ef7635157519adc96718e3369890755 /danger/documentation
parentfdcdc36eecdbe904cf80fa130aebf4edd34c3f12 (diff)
downloadgitlab-ce-253e1818aa3efafb05d9994aab0f778d339e26ac.tar.gz
Create helper to get all changed filesleipert-danger-fix-moved-files
Danger apparently has three different objects which could contain files you often want to check: - git.added_files - git.modified_files - git.renamed_files The problem: If a file is renamed, `modified_files` contains the file path before the rename. In some Danger checks we use `added_files` + `modified_files`, which might contain the deleted paths of renamed files, but missing the new paths of renamed files. So we need to consider `renamed_files` as well.
Diffstat (limited to 'danger/documentation')
-rw-r--r--danger/documentation/Dangerfile4
1 files changed, 1 insertions, 3 deletions
diff --git a/danger/documentation/Dangerfile b/danger/documentation/Dangerfile
index d65bec123a9..fe819ee250c 100644
--- a/danger/documentation/Dangerfile
+++ b/danger/documentation/Dangerfile
@@ -11,9 +11,7 @@ def docs_paths_requiring_review(files)
end
end
-all_files = git.added_files + git.modified_files
-
-docs_paths_to_review = docs_paths_requiring_review(all_files)
+docs_paths_to_review = docs_paths_requiring_review(helper.all_changed_files)
unless docs_paths_to_review.empty?
message 'This merge request adds or changes files that require a ' \