Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-07-10 13:10:54 +0300
committerRémy Coutable <remy@rymai.me>2018-07-11 12:52:03 +0300
commitab87e7bab1d5cc20c7b69644843bfcb1f3f16918 (patch)
tree2f908718378fbe6984d65781ea76c623ace57eb6 /danger/specs
parentdc629bb6b8146477fdbf9fcd11d10ebedc785029 (diff)
Improve Danger files after first review
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'danger/specs')
-rw-r--r--danger/specs/Dangerfile13
1 files changed, 7 insertions, 6 deletions
diff --git a/danger/specs/Dangerfile b/danger/specs/Dangerfile
index 88e64c57a4b..0ed5235ec02 100644
--- a/danger/specs/Dangerfile
+++ b/danger/specs/Dangerfile
@@ -1,13 +1,14 @@
# rubocop:disable Style/SignalException
+NO_NEW_SPEC_MESSAGE = <<~MSG
+You've made some app changes, but didn't add any tests.
+That's OK as long as you're refactoring existing code,
+but please consider adding the ~backstage label in that case.
+MSG
+
has_app_changes = !git.modified_files.grep(%r{\A(ee/)?(app|lib|db/(geo/)?(post_)?migrate)/}).empty?
has_spec_changes = !git.modified_files.grep(/spec/).empty?
if has_app_changes && !has_spec_changes
- msg = [
- "You've made some app changes, but didn't add any tests.",
- "That's OK as long as you're refactoring existing code (please consider adding the ~backstage label in that case)."
- ]
-
- warn msg.join(" "), sticky: false
+ warn NO_NEW_SPEC_MESSAGE, sticky: false
end