diff --git a/Library/Homebrew/locale.rb b/Library/Homebrew/locale.rb index 854e1df8f2..acb9f81c5f 100644 --- a/Library/Homebrew/locale.rb +++ b/Library/Homebrew/locale.rb @@ -13,7 +13,7 @@ class Locale def self.parse(string) string = string.to_s - raise ParserError, "'#{string}' cannot be parsed to a #{self}" if !LOCALE_REGEX.match?(string) + raise ParserError, "'#{string}' cannot be parsed to a #{self}" unless LOCALE_REGEX.match?(string) scan = proc do |regex| string.scan(/(?:\-|^)(#{regex})(?:\-|$)/).flatten.first diff --git a/Library/Homebrew/rubocops/cask/homepage_url_trailing_slash.rb b/Library/Homebrew/rubocops/cask/homepage_url_trailing_slash.rb index 9f00a07d84..bf39a191ea 100644 --- a/Library/Homebrew/rubocops/cask/homepage_url_trailing_slash.rb +++ b/Library/Homebrew/rubocops/cask/homepage_url_trailing_slash.rb @@ -17,7 +17,7 @@ module RuboCop url_node = stanza.stanza_node.first_argument url = url_node.str_content - return if !%r{^.+://[^/]+$}.match?(url) + return unless %r{^.+://[^/]+$}.match?(url) add_offense(url_node, location: :expression, message: format(MSG_NO_SLASH, url: url)) diff --git a/Library/Homebrew/rubocops/patches.rb b/Library/Homebrew/rubocops/patches.rb index 03f2e72997..5bbb578e16 100644 --- a/Library/Homebrew/rubocops/patches.rb +++ b/Library/Homebrew/rubocops/patches.rb @@ -30,7 +30,7 @@ module RuboCop patch_url = string_content(patch) gh_patch_param_pattern = %r{https?://github\.com/.+/.+/(?:commit|pull)/[a-fA-F0-9]*.(?:patch|diff)} if regex_match_group(patch, gh_patch_param_pattern) - if !/\?full_index=\w+$/.match?(patch_url) + unless /\?full_index=\w+$/.match?(patch_url) problem <<~EOS GitHub patches should use the full_index parameter: #{patch_url}?full_index=1 @@ -43,7 +43,7 @@ module RuboCop %r{gist\.github\.com/.+/raw}, %r{gist\.githubusercontent\.com/.+/raw}]) if regex_match_group(patch, gh_patch_patterns) - if !/[a-fA-F0-9]{40}/.match?(patch_url) + unless /[a-fA-F0-9]{40}/.match?(patch_url) problem <<~EOS.chomp GitHub/Gist patches should specify a revision: #{patch_url}