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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-11-14 21:09:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-11-14 21:09:21 +0300
commitc3ccd2fdf136f7b3962ef5243ed6ce01de47d8ef (patch)
tree4d8b1df9d6b4bc09edcf8ae610e014b36a2d4269 /tooling
parent15c1cc886c5785d49f2a6dae064a1e8290f59f46 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'tooling')
-rw-r--r--tooling/danger/outdated_todo.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/tooling/danger/outdated_todo.rb b/tooling/danger/outdated_todo.rb
index a5f5cc897a9..5ae0561010c 100644
--- a/tooling/danger/outdated_todo.rb
+++ b/tooling/danger/outdated_todo.rb
@@ -8,10 +8,11 @@ module Tooling
spec/support/rspec_order_todo.yml
].freeze
- def initialize(filenames, context:, todos: TODOS_GLOBS)
+ def initialize(filenames, context:, todos: TODOS_GLOBS, allow_fail: false)
@filenames = filenames
@context = context
@todos_globs = todos
+ @allow_fail = allow_fail
end
def check
@@ -22,17 +23,23 @@ module Tooling
private
- attr_reader :filenames, :context
+ attr_reader :filenames, :context, :allow_fail
def check_filename(filename)
mentions = all_mentions_for(filename)
return if mentions.empty?
- context.warn <<~MESSAGE
+ message = <<~MESSAGE
`#{filename}` was removed but is mentioned in:
#{mentions.join("\n")}
MESSAGE
+
+ if allow_fail
+ context.fail message
+ else
+ context.warn message
+ end
end
def all_mentions_for(filename)