Merge pull request #8775 from reitermarkus/desc-macos-vm
Allow “macOS virtual machines” in descriptions.
This commit is contained in:
commit
c110fb60a6
@ -65,7 +65,7 @@ module RuboCop
|
||||
problem "Description shouldn't start with the #{type} name." if regex_match_group(desc, /^#{name_regex}\b/i)
|
||||
|
||||
if type == :cask &&
|
||||
(match = regex_match_group(desc, /\b(macOS|Mac( ?OS( ?X)?)?|OS ?X)\b/i)) &&
|
||||
(match = regex_match_group(desc, /\b(macOS|Mac( ?OS( ?X)?)?|OS ?X)(?! virtual machines?)\b/i)) &&
|
||||
match[1] != "MAC"
|
||||
problem "Description shouldn't contain the platform."
|
||||
end
|
||||
|
@ -93,6 +93,19 @@ describe RuboCop::Cop::Cask::Desc do
|
||||
end
|
||||
RUBY
|
||||
|
||||
expect_no_offenses <<~RUBY
|
||||
cask 'foo' do
|
||||
desc 'Application for managing macOS virtual machines'
|
||||
end
|
||||
RUBY
|
||||
|
||||
expect_offense <<~RUBY
|
||||
cask 'foo' do
|
||||
desc 'Application for managing macOS virtual machines on macOS'
|
||||
^^^^^ Description shouldn\'t contain the platform.
|
||||
end
|
||||
RUBY
|
||||
|
||||
expect_no_offenses <<~RUBY
|
||||
cask 'foo' do
|
||||
desc 'MAC address changer'
|
||||
|
Loading…
x
Reference in New Issue
Block a user