[rubygems/rubygems] util/rubocop -A --only Style/CommentAnnotation
https://github.com/rubygems/rubygems/commit/4e77a1d1d5
This commit is contained in:
parent
52ea7afa5f
commit
66bd2c1a1c
@ -268,7 +268,7 @@ Gem::Platform::CURRENT. This will correctly mark the gem with your ruby's
|
|||||||
platform.
|
platform.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# NOTE when updating also update Gem::Command::HELP
|
# NOTE: when updating also update Gem::Command::HELP
|
||||||
|
|
||||||
SUBCOMMANDS = [
|
SUBCOMMANDS = [
|
||||||
["commands", :show_commands],
|
["commands", :show_commands],
|
||||||
|
@ -201,7 +201,7 @@ class Gem::ConfigFile
|
|||||||
@hash = @hash.merge environment_config
|
@hash = @hash.merge environment_config
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK these override command-line args, which is bad
|
# HACK: these override command-line args, which is bad
|
||||||
@backtrace = @hash[:backtrace] if @hash.key? :backtrace
|
@backtrace = @hash[:backtrace] if @hash.key? :backtrace
|
||||||
@bulk_threshold = @hash[:bulk_threshold] if @hash.key? :bulk_threshold
|
@bulk_threshold = @hash[:bulk_threshold] if @hash.key? :bulk_threshold
|
||||||
@home = @hash[:gemhome] if @hash.key? :gemhome
|
@home = @hash[:gemhome] if @hash.key? :gemhome
|
||||||
|
@ -18,12 +18,12 @@ class Gem::DependencyInstaller
|
|||||||
DEFAULT_OPTIONS = { # :nodoc:
|
DEFAULT_OPTIONS = { # :nodoc:
|
||||||
:env_shebang => false,
|
:env_shebang => false,
|
||||||
:document => %w[ri],
|
:document => %w[ri],
|
||||||
:domain => :both, # HACK dup
|
:domain => :both, # HACK: dup
|
||||||
:force => false,
|
:force => false,
|
||||||
:format_executable => false, # HACK dup
|
:format_executable => false, # HACK: dup
|
||||||
:ignore_dependencies => false,
|
:ignore_dependencies => false,
|
||||||
:prerelease => false,
|
:prerelease => false,
|
||||||
:security_policy => nil, # HACK NoSecurity requires OpenSSL. AlmostNo? Low?
|
:security_policy => nil, # HACK: NoSecurity requires OpenSSL. AlmostNo? Low?
|
||||||
:wrappers => true,
|
:wrappers => true,
|
||||||
:build_args => nil,
|
:build_args => nil,
|
||||||
:build_docs_in_background => false,
|
:build_docs_in_background => false,
|
||||||
|
@ -43,7 +43,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|||||||
|
|
||||||
full_tmp_dest = File.join(extension_dir, tmp_dest_relative)
|
full_tmp_dest = File.join(extension_dir, tmp_dest_relative)
|
||||||
|
|
||||||
# TODO remove in RubyGems 4
|
# TODO: remove in RubyGems 4
|
||||||
if Gem.install_extension_in_lib && lib_dir
|
if Gem.install_extension_in_lib && lib_dir
|
||||||
FileUtils.mkdir_p lib_dir
|
FileUtils.mkdir_p lib_dir
|
||||||
entries = Dir.entries(full_tmp_dest) - %w[. ..]
|
entries = Dir.entries(full_tmp_dest) - %w[. ..]
|
||||||
|
@ -233,7 +233,7 @@ class Gem::Installer
|
|||||||
|
|
||||||
io.gets # blankline
|
io.gets # blankline
|
||||||
|
|
||||||
# TODO detect a specially formatted comment instead of trying
|
# TODO: detect a specially formatted comment instead of trying
|
||||||
# to find a string inside Ruby code.
|
# to find a string inside Ruby code.
|
||||||
next unless io.gets.to_s.include?("This file was generated by RubyGems")
|
next unless io.gets.to_s.include?("This file was generated by RubyGems")
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ class Gem::Installer
|
|||||||
|
|
||||||
spec
|
spec
|
||||||
|
|
||||||
# TODO This rescue is in the wrong place. What is raising this exception?
|
# TODO: This rescue is in the wrong place. What is raising this exception?
|
||||||
# move this rescue to around the code that actually might raise it.
|
# move this rescue to around the code that actually might raise it.
|
||||||
rescue Zlib::GzipFile::Error
|
rescue Zlib::GzipFile::Error
|
||||||
raise Gem::InstallError, "gzip error installing #{gem}"
|
raise Gem::InstallError, "gzip error installing #{gem}"
|
||||||
@ -748,7 +748,7 @@ class Gem::Installer
|
|||||||
# Return the text for an application file.
|
# Return the text for an application file.
|
||||||
|
|
||||||
def app_script_text(bin_file_name)
|
def app_script_text(bin_file_name)
|
||||||
# note that the `load` lines cannot be indented, as old RG versions match
|
# NOTE: that the `load` lines cannot be indented, as old RG versions match
|
||||||
# against the beginning of the line
|
# against the beginning of the line
|
||||||
return <<-TEXT
|
return <<-TEXT
|
||||||
#{shebang bin_file_name}
|
#{shebang bin_file_name}
|
||||||
|
@ -36,7 +36,7 @@ class Gem::Platform
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.match_gem?(platform, gem_name)
|
def self.match_gem?(platform, gem_name)
|
||||||
# Note: this method might be redefined by Ruby implementations to
|
# NOTE: this method might be redefined by Ruby implementations to
|
||||||
# customize behavior per RUBY_ENGINE, gem_name or other criteria.
|
# customize behavior per RUBY_ENGINE, gem_name or other criteria.
|
||||||
match_platforms?(platform, Gem.platforms)
|
match_platforms?(platform, Gem.platforms)
|
||||||
end
|
end
|
||||||
|
@ -169,7 +169,7 @@ class Gem::RemoteFetcher
|
|||||||
end
|
end
|
||||||
|
|
||||||
verbose "Using local gem #{local_gem_path}"
|
verbose "Using local gem #{local_gem_path}"
|
||||||
when nil then # TODO test for local overriding cache
|
when nil then # TODO: test for local overriding cache
|
||||||
source_path = if Gem.win_platform? && source_uri.scheme &&
|
source_path = if Gem.win_platform? && source_uri.scheme &&
|
||||||
!source_uri.path.include?(":")
|
!source_uri.path.include?(":")
|
||||||
"#{source_uri.scheme}:#{source_uri.path}"
|
"#{source_uri.scheme}:#{source_uri.path}"
|
||||||
|
@ -241,7 +241,7 @@ class Gem::Request
|
|||||||
verbose "fatal error"
|
verbose "fatal error"
|
||||||
|
|
||||||
raise Gem::RemoteFetcher::FetchError.new("fatal error", @uri)
|
raise Gem::RemoteFetcher::FetchError.new("fatal error", @uri)
|
||||||
# HACK work around EOFError bug in Net::HTTP
|
# HACK: work around EOFError bug in Net::HTTP
|
||||||
# NOTE Errno::ECONNABORTED raised a lot on Windows, and make impossible
|
# NOTE Errno::ECONNABORTED raised a lot on Windows, and make impossible
|
||||||
# to install gems.
|
# to install gems.
|
||||||
rescue EOFError, Timeout::Error,
|
rescue EOFError, Timeout::Error,
|
||||||
|
@ -49,7 +49,7 @@ class Gem::Security::TrustDir
|
|||||||
|
|
||||||
yield certificate, certificate_file
|
yield certificate, certificate_file
|
||||||
rescue OpenSSL::X509::CertificateError
|
rescue OpenSSL::X509::CertificateError
|
||||||
next # HACK warn
|
next # HACK: warn
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1502,7 +1502,7 @@ class Gem::Specification < Gem::BasicSpecification
|
|||||||
def sanitize_string(string)
|
def sanitize_string(string)
|
||||||
return string unless string
|
return string unless string
|
||||||
|
|
||||||
# HACK the #to_s is in here because RSpec has an Array of Arrays of
|
# HACK: the #to_s is in here because RSpec has an Array of Arrays of
|
||||||
# Strings for authors. Need a way to disallow bad values on gemspec
|
# Strings for authors. Need a way to disallow bad values on gemspec
|
||||||
# generation. (Probably won't happen.)
|
# generation. (Probably won't happen.)
|
||||||
string.to_s
|
string.to_s
|
||||||
|
@ -45,7 +45,7 @@ class Gem::Uninstaller
|
|||||||
# Constructs an uninstaller that will uninstall +gem+
|
# Constructs an uninstaller that will uninstall +gem+
|
||||||
|
|
||||||
def initialize(gem, options = {})
|
def initialize(gem, options = {})
|
||||||
# TODO document the valid options
|
# TODO: document the valid options
|
||||||
@gem = gem
|
@gem = gem
|
||||||
@version = options[:version] || Gem::Requirement.default
|
@version = options[:version] || Gem::Requirement.default
|
||||||
@gem_home = File.realpath(options[:install_dir] || Gem.dir)
|
@gem_home = File.realpath(options[:install_dir] || Gem.dir)
|
||||||
|
@ -108,7 +108,7 @@ class Gem::Validator
|
|||||||
|
|
||||||
good.each do |entry, data|
|
good.each do |entry, data|
|
||||||
begin
|
begin
|
||||||
next unless data # HACK `gem check -a mkrf`
|
next unless data # HACK: `gem check -a mkrf`
|
||||||
|
|
||||||
source = File.join gem_directory, entry["path"]
|
source = File.join gem_directory, entry["path"]
|
||||||
|
|
||||||
|
@ -1045,7 +1045,7 @@ Also, a list:
|
|||||||
spec_fetcher.prerelease_specs[@uri] << spec.name_tuple
|
spec_fetcher.prerelease_specs[@uri] << spec.name_tuple
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK for test_download_to_cache
|
# HACK: for test_download_to_cache
|
||||||
unless Gem::RemoteFetcher === @fetcher
|
unless Gem::RemoteFetcher === @fetcher
|
||||||
v = Gem.marshal_version
|
v = Gem.marshal_version
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ class TestGemCommandManager < Gem::TestCase
|
|||||||
assert_match(/invalid option: --bad-arg/i, @ui.error)
|
assert_match(/invalid option: --bad-arg/i, @ui.error)
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK move to install command test
|
# HACK: move to install command test
|
||||||
def test_process_args_install
|
def test_process_args_install
|
||||||
# capture all install options
|
# capture all install options
|
||||||
use_ui @ui do
|
use_ui @ui do
|
||||||
@ -227,7 +227,7 @@ class TestGemCommandManager < Gem::TestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK move to uninstall command test
|
# HACK: move to uninstall command test
|
||||||
def test_process_args_uninstall
|
def test_process_args_uninstall
|
||||||
# capture all uninstall options
|
# capture all uninstall options
|
||||||
check_options = nil
|
check_options = nil
|
||||||
@ -247,7 +247,7 @@ class TestGemCommandManager < Gem::TestCase
|
|||||||
assert_equal Gem::Requirement.new("3.0"), check_options[:version]
|
assert_equal Gem::Requirement.new("3.0"), check_options[:version]
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK move to check command test
|
# HACK: move to check command test
|
||||||
def test_process_args_check
|
def test_process_args_check
|
||||||
# capture all check options
|
# capture all check options
|
||||||
check_options = nil
|
check_options = nil
|
||||||
@ -266,7 +266,7 @@ class TestGemCommandManager < Gem::TestCase
|
|||||||
assert_equal true, check_options[:alien]
|
assert_equal true, check_options[:alien]
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK move to build command test
|
# HACK: move to build command test
|
||||||
def test_process_args_build
|
def test_process_args_build
|
||||||
# capture all build options
|
# capture all build options
|
||||||
check_options = nil
|
check_options = nil
|
||||||
@ -285,7 +285,7 @@ class TestGemCommandManager < Gem::TestCase
|
|||||||
assert_equal "foobar.rb", check_options[:args].first
|
assert_equal "foobar.rb", check_options[:args].first
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK move to query command test
|
# HACK: move to query command test
|
||||||
def test_process_args_query
|
def test_process_args_query
|
||||||
# capture all query options
|
# capture all query options
|
||||||
check_options = nil
|
check_options = nil
|
||||||
@ -326,7 +326,7 @@ class TestGemCommandManager < Gem::TestCase
|
|||||||
assert_equal :both, check_options[:domain]
|
assert_equal :both, check_options[:domain]
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK move to update command test
|
# HACK: move to update command test
|
||||||
def test_process_args_update
|
def test_process_args_update
|
||||||
# capture all update options
|
# capture all update options
|
||||||
check_options = nil
|
check_options = nil
|
||||||
|
@ -46,7 +46,7 @@ class TestGemCommandsCertCommand < Gem::TestCase
|
|||||||
|
|
||||||
matches = @cmd.certificates_matching ""
|
matches = @cmd.certificates_matching ""
|
||||||
|
|
||||||
# HACK OpenSSL::X509::Certificate#== is Object#==, so do this the hard way
|
# HACK: OpenSSL::X509::Certificate#== is Object#==, so do this the hard way
|
||||||
match = matches.next
|
match = matches.next
|
||||||
assert_equal ALTERNATE_CERT.to_pem, match.first.to_pem
|
assert_equal ALTERNATE_CERT.to_pem, match.first.to_pem
|
||||||
assert_equal @trust_dir.cert_path(ALTERNATE_CERT), match.last
|
assert_equal @trust_dir.cert_path(ALTERNATE_CERT), match.last
|
||||||
|
@ -232,7 +232,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
|
|||||||
assert_equal 2, e.exit_code
|
assert_equal 2, e.exit_code
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK no repository was checked
|
# HACK: no repository was checked
|
||||||
assert_match(/ould not find a valid gem 'no_such_gem'/, @ui.error)
|
assert_match(/ould not find a valid gem 'no_such_gem'/, @ui.error)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ ERROR: Could not find a valid gem 'bar' (= 0.5) (required by 'foo' (>= 0)) in a
|
|||||||
assert_equal 2, e.exit_code
|
assert_equal 2, e.exit_code
|
||||||
end
|
end
|
||||||
|
|
||||||
# HACK no repository was checked
|
# HACK: no repository was checked
|
||||||
assert_match(/ould not find a valid gem 'no_such_gem'/, @ui.error)
|
assert_match(/ould not find a valid gem 'no_such_gem'/, @ui.error)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -496,7 +496,7 @@ gem 'other', version
|
|||||||
|
|
||||||
wrapper = File.read installed_exec
|
wrapper = File.read installed_exec
|
||||||
assert_match %r{generated by RubyGems}, wrapper
|
assert_match %r{generated by RubyGems}, wrapper
|
||||||
# HACK some gems don't have #! in their executables, restore 2008/06
|
# HACK: some gems don't have #! in their executables, restore 2008/06
|
||||||
# assert_no_match %r|generated by RubyGems|, wrapper
|
# assert_no_match %r|generated by RubyGems|, wrapper
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ class TestGemSecurityPolicy < Gem::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
@digest = OpenSSL::Digest.new Gem::Security::DIGEST_NAME
|
@digest = OpenSSL::Digest.new Gem::Security::DIGEST_NAME
|
||||||
@trust_dir = Gem::Security.trust_dir.dir # HACK use the object
|
@trust_dir = Gem::Security.trust_dir.dir # HACK: use the object
|
||||||
|
|
||||||
@no = Gem::Security::NoSecurity
|
@no = Gem::Security::NoSecurity
|
||||||
@almost_no = Gem::Security::AlmostNoSecurity
|
@almost_no = Gem::Security::AlmostNoSecurity
|
||||||
|
Loading…
x
Reference in New Issue
Block a user