From 69e89d7a0159c81cad5b40af3856bd465fa28355 Mon Sep 17 00:00:00 2001 From: Rylan Polster Date: Fri, 10 Jul 2020 15:07:28 -0400 Subject: [PATCH] add TODOs for future refactoring --- Library/Homebrew/rubocops/lines.rb | 1 + Library/Homebrew/rubocops/text.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/Library/Homebrew/rubocops/lines.rb b/Library/Homebrew/rubocops/lines.rb index a2566fb8fb..0310b94348 100644 --- a/Library/Homebrew/rubocops/lines.rb +++ b/Library/Homebrew/rubocops/lines.rb @@ -118,6 +118,7 @@ module RuboCop depends_on_build_regex = /depends_on .+ (if build\.with(out)?\?\(["']\w+["']\))/ find_instance_method_call(body_node, :build, :with?) do |n| + # TODO: this should be refactored to a direct method match next unless match = n.parent.source.match(depends_on_build_regex) problem "Use `:optional` or `:recommended` instead of `#{match[1]}`" diff --git a/Library/Homebrew/rubocops/text.rb b/Library/Homebrew/rubocops/text.rb index ff86ddd1c4..85f0a89ba4 100644 --- a/Library/Homebrew/rubocops/text.rb +++ b/Library/Homebrew/rubocops/text.rb @@ -112,6 +112,7 @@ module RuboCop parent = n.parent # Only look at keywords that have `prefix` before them + # TODO: this should be refactored to a direct method match prefix_keyword_regex = %r{(prefix\s*\+\s*["'](bin|include|libexec|lib|sbin|share|Frameworks))["'/]} if match = parent.source.match(prefix_keyword_regex) offending_node(parent)