add Lint/DuplicateBranch cop exceptions

This commit is contained in:
Rylan Polster 2020-11-13 10:57:20 -05:00 committed by Markus Reiter
parent 50890ebd51
commit 20ee7e8881
4 changed files with 8 additions and 2 deletions

View File

@ -64,7 +64,7 @@ module Cask
MacOSRequirement.new([version.to_sym], comparator: comparator)
elsif /^\s*(?<comparator><|>|[=<>]=)\s*(?<version>\S+)\s*$/ =~ args.first
MacOSRequirement.new([version], comparator: comparator)
else
else # rubocop:disable Lint/DuplicateBranch
MacOSRequirement.new([args.first], comparator: "==")
end
rescue MacOSVersionError => e

View File

@ -450,7 +450,7 @@ module Homebrew
"any"
elsif cellars.include?("any_skip_relocation")
"any_skip_relocation"
else
else # rubocop:disable Lint/DuplicateBranch
second
end
else

View File

@ -189,6 +189,7 @@ module OS
# installed CLT version. This is useful as they are packaged
# simultaneously so workarounds need to apply to both based on their
# comparable version.
# rubocop:disable Lint/DuplicateBranch
latest_stable = "12.0"
case (DevelopmentTools.clang_version.to_f * 10).to_i
when 120 then latest_stable
@ -205,6 +206,7 @@ module OS
when 0 then "dunno"
else latest_stable
end
# rubocop:enable Lint/DuplicateBranch
end
def default_prefix?
@ -274,6 +276,7 @@ module OS
# Bump these when the new version is distributed through Software Update
# and our CI systems have been updated.
# rubocop:disable Lint/DuplicateBranch
sig { returns(String) }
def latest_clang_version
case MacOS.version
@ -287,6 +290,7 @@ module OS
else "600.0.57"
end
end
# rubocop:enable Lint/DuplicateBranch
# Bump these if things are badly broken (e.g. no SDK for this macOS)
# without this. Generally this will be the first stable CLT release on

View File

@ -22,6 +22,7 @@ module RuboCop
problem "The homepage should start with http or https (URL is #{homepage})."
end
# rubocop:disable Lint/DuplicateBranch
case homepage
# Check for http:// GitHub homepage URLs, https:// is preferred.
# Note: only check homepages that are repo pages, not *.github.com hosts
@ -88,6 +89,7 @@ module RuboCop
%r{^http://(?:[^/]*\.)?archive\.org}
problem "Please use https:// for #{homepage}"
end
# rubocop:enable Lint/DuplicateBranch
end
def autocorrect(node)