From e062812c38787dbd37c95c6dda1d32c9dce6a3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Wed, 3 Jun 2020 15:45:28 +0200 Subject: [PATCH] Prevent invalid warnings about missing identifiers The Danger script inspects differences between the current version of a given merge request's target branch and the merge request branch. If the latter falls behind the former, the Danger script will wrongly warn about missing GitLab/RT identifiers because it incorrectly treats the "+++" diff marker as an indication of the merge request adding new lines to a file. Tweak the relevant conditional expression to prevent such invalid warnings from being raised. --- dangerfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dangerfile.py b/dangerfile.py index 09f28cb4d6..3a047c974d 100644 --- a/dangerfile.py +++ b/dangerfile.py @@ -21,7 +21,7 @@ def added_lines(target_branch, paths): '--'] + paths) added_lines = [] for line in diff.splitlines(): - if line.startswith(b'+'): + if line.startswith(b'+') and not line.startswith(b'+++'): added_lines.append(line) return added_lines