Fix and remove various TODOs.

Fix those that can be done so without tearing Homebrew to pieces and
remove the comments for those that can never be done.
This commit is contained in:
Mike McQuaid 2017-04-23 15:10:18 +01:00
parent e7e53b89fc
commit 45a7730f61
11 changed files with 7 additions and 20 deletions

View File

@ -23,8 +23,7 @@ end
def require?(path) def require?(path)
require path require path
rescue LoadError => e rescue LoadError => e
# HACK: ( because we should raise on syntax errors but # we should raise on syntax errors but not if the file doesn't exist.
# not if the file doesn't exist. TODO make robust!
raise unless e.to_s.include? path raise unless e.to_s.include? path
end end

View File

@ -20,8 +20,6 @@ module Dependable
end end
def required? def required?
# FIXME: Should `required?` really imply `!build?`? And if so, why doesn't
# any of `optional?` and `recommended?` equally imply `!build?`?
!build? && !optional? && !recommended? !build? && !optional? && !recommended?
end end

View File

@ -1,7 +1,6 @@
require "hardware" require "hardware"
require "extend/ENV/shared" require "extend/ENV/shared"
# TODO: deprecate compiling related codes after it's only used by brew test.
# @private # @private
module Stdenv module Stdenv
include SharedEnvExtension include SharedEnvExtension

View File

@ -331,7 +331,6 @@ class Pathname
raise ChecksumMismatchError.new(self, expected, actual) unless expected == actual raise ChecksumMismatchError.new(self, expected, actual) unless expected == actual
end end
# FIXME: eliminate the places where we rely on this method
alias to_str to_s unless method_defined?(:to_str) alias to_str to_s unless method_defined?(:to_str)
def cd def cd

View File

@ -1908,7 +1908,6 @@ class Formula
def exec_cmd(cmd, args, out, logfn) def exec_cmd(cmd, args, out, logfn)
ENV["HOMEBREW_CC_LOG_PATH"] = logfn ENV["HOMEBREW_CC_LOG_PATH"] = logfn
# TODO: system "xcodebuild" is deprecated, this should be removed soon.
ENV.remove_cc_etc if cmd.to_s.start_with? "xcodebuild" ENV.remove_cc_etc if cmd.to_s.start_with? "xcodebuild"
# Turn on argument filtering in the superenv compiler wrapper. # Turn on argument filtering in the superenv compiler wrapper.

View File

@ -887,6 +887,6 @@ class FormulaInstaller
def puts_requirement_messages def puts_requirement_messages
return unless @requirement_messages return unless @requirement_messages
return if @requirement_messages.empty? return if @requirement_messages.empty?
puts @requirement_messages $stderr.puts @requirement_messages
end end
end end

View File

@ -62,7 +62,6 @@ ORIGINAL_PATHS = ENV["HOMEBREW_PATH"].split(File::PATH_SEPARATOR).map do |p|
end end
end.compact.freeze end.compact.freeze
# TODO: remove this as soon as it's removed from commands.rb.
HOMEBREW_INTERNAL_COMMAND_ALIASES = { HOMEBREW_INTERNAL_COMMAND_ALIASES = {
"ls" => "list", "ls" => "list",
"homepage" => "home", "homepage" => "home",

View File

@ -5,7 +5,6 @@ module OS
module XQuartz module XQuartz
module_function module_function
# TODO: confirm this path when you have internet
DEFAULT_BUNDLE_PATH = Pathname.new("Applications/Utilities/XQuartz.app").freeze DEFAULT_BUNDLE_PATH = Pathname.new("Applications/Utilities/XQuartz.app").freeze
FORGE_BUNDLE_ID = "org.macosforge.xquartz.X11".freeze FORGE_BUNDLE_ID = "org.macosforge.xquartz.X11".freeze
APPLE_BUNDLE_ID = "org.x.X11".freeze APPLE_BUNDLE_ID = "org.x.X11".freeze

View File

@ -217,10 +217,9 @@ describe "brew install", :integration_test do
depends_on NonFatalRequirement depends_on NonFatalRequirement
EOS EOS
# FIXME: This should output to STDERR.
expect { brew "install", "testball1" } expect { brew "install", "testball1" }
.to output(/NonFatalRequirement unsatisfied!/).to_stdout .to output(/NonFatalRequirement unsatisfied!/).to_stderr
.and not_to_output.to_stderr .and output(/built in/).to_stdout
.and be_a_success .and be_a_success
end end
@ -234,10 +233,9 @@ describe "brew install", :integration_test do
depends_on FatalRequirement depends_on FatalRequirement
EOS EOS
# FIXME: This should output to STDERR.
expect { brew "install", "testball1" } expect { brew "install", "testball1" }
.to output(/FatalRequirement unsatisfied!/).to_stdout .to output(/FatalRequirement unsatisfied!/).to_stderr
.and output(/An unsatisfied requirement failed this build./).to_stderr .and not_to_output.to_stdout
.and be_a_failure .and be_a_failure
end end
end end

View File

@ -85,8 +85,6 @@ report-analytics-screenview-command() {
fi fi
# Don't report commands used mostly by our scripts and not users. # Don't report commands used mostly by our scripts and not users.
# TODO: list more e.g. shell completion things here perhaps using a single
# script as a shell-completion entry point.
case "$HOMEBREW_COMMAND" in case "$HOMEBREW_COMMAND" in
--prefix|analytics|command|commands) --prefix|analytics|command|commands)
return return

View File

@ -47,8 +47,7 @@ HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library"
for VAR in EDITOR PATH for VAR in EDITOR PATH
do do
VAR_NEW="HOMEBREW_${VAR}" VAR_NEW="HOMEBREW_${VAR}"
# TODO: find a better solution than this. [[ -n "${!VAR_NEW}" ]] && continue
env | grep -q "$VAR_NEW" && continue
export "$VAR_NEW"="${!VAR}" export "$VAR_NEW"="${!VAR}"
done done