[rubygems/rubygems] util/rubocop -A --only Style/NegatedIf

https://github.com/rubygems/rubygems/commit/aa95ee27a2
This commit is contained in:
Hiroshi SHIBATA 2023-03-16 13:35:34 +09:00
Родитель 9ab860f9af
Коммит 52ea7afa5f
7 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -135,7 +135,7 @@ class Gem::Commands::CertCommand < Gem::Command
end
def build(email)
if !valid_email?(email)
unless valid_email?(email)
raise Gem::CommandLineError, "Invalid email address #{email}"
end

Просмотреть файл

@ -84,7 +84,7 @@ module Gem::QueryUtils
installed = !installed unless options[:installed]
say(installed)
exit_code = 1 if !installed
exit_code = 1 unless installed
end
exit_code

Просмотреть файл

@ -44,12 +44,12 @@ class Gem::Source
Gem::Source::Vendor then
-1
when Gem::Source then
if !@uri
unless @uri
return 0 unless other.uri
return 1
end
return -1 if !other.uri
return -1 unless other.uri
# Returning 1 here ensures that when sorting a list of sources, the
# original ordering of sources supplied by the user is preserved.

Просмотреть файл

@ -1616,8 +1616,8 @@ class Gem::Specification < Gem::BasicSpecification
# we need to fresh build when same name and version of default gems
return if self.class.find_by_full_name(full_name)&.default_gem?
return if File.exist? gem_build_complete_path
return if !File.writable?(base_dir)
return if !File.exist?(File.join(base_dir, "extensions"))
return unless File.writable?(base_dir)
return unless File.exist?(File.join(base_dir, "extensions"))
begin
# We need to require things in $LOAD_PATH without looking for the

Просмотреть файл

@ -125,7 +125,7 @@ class Gem::SpecificationPolicy
metadata.each do |key, value|
entry = "metadata['#{key}']"
if !key.is_a?(String)
unless key.is_a?(String)
error "metadata keys must be a String"
end
@ -133,7 +133,7 @@ class Gem::SpecificationPolicy
error "metadata key is too large (#{key.size} > 128)"
end
if !value.is_a?(String)
unless value.is_a?(String)
error "#{entry} value must be a String"
end
@ -368,7 +368,7 @@ duplicate dependency on #{dep}, (#{prev.requirement}) use:
licenses = @specification.licenses
licenses.each do |license|
if !Gem::Licenses.match?(license)
unless Gem::Licenses.match?(license)
suggestions = Gem::Licenses.suggestions(license)
message = <<-WARNING
license value '#{license}' is invalid. Use a license identifier from

Просмотреть файл

@ -281,7 +281,7 @@ class Gem::StreamUI
# Ask a question. Returns an answer if connected to a tty, nil otherwise.
def ask(question)
return nil if !tty?
return nil unless tty?
@outs.print(question + " ")
@outs.flush
@ -295,7 +295,7 @@ class Gem::StreamUI
# Ask for a password. Does not echo response to terminal.
def ask_for_password(question)
return nil if !tty?
return nil unless tty?
@outs.print(question, " ")
@outs.flush

Просмотреть файл

@ -83,7 +83,7 @@ class TestGemRequirement < Gem::TestCase
Gem::Requirement.parse(Gem::Version.new("2"))
end
if !(Gem.java_platform? && ENV["JRUBY_OPTS"].to_s.include?("--debug"))
unless (Gem.java_platform? && ENV["JRUBY_OPTS"].to_s.include?("--debug"))
def test_parse_deduplication
assert_same "~>", Gem::Requirement.parse("~> 1").first
end