summaryrefslogtreecommitdiff
path: root/danger/prettier
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/prettier
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/prettier')
-rw-r--r--danger/prettier/Dangerfile2
1 files changed, 1 insertions, 1 deletions
diff --git a/danger/prettier/Dangerfile b/danger/prettier/Dangerfile
index 86f9f6af475..37c4b78a213 100644
--- a/danger/prettier/Dangerfile
+++ b/danger/prettier/Dangerfile
@@ -6,7 +6,7 @@ def get_prettier_files(files)
end
end
-prettier_candidates = get_prettier_files(git.added_files + git.modified_files)
+prettier_candidates = get_prettier_files(helper.all_changed_files)
return if prettier_candidates.empty?