Skip to content

Commit 0c18f84

Browse files
committed
Merge pull request #1613 from will-in-wi/rubocop_raise_args
Enable RaiseArgs cop
2 parents 6a89bd0 + bd9029d commit 0c18f84

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed

.rubocop.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ Style/Lambda:
5151
Enabled: false
5252
Style/EmptyLiteral:
5353
Enabled: false
54-
Style/RaiseArgs:
55-
Enabled: false
5654
Style/SingleLineBlockParams:
5755
Enabled: false
5856
Style/Not:

lib/capistrano/configuration.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def is_question?(key)
8181

8282
def role(name, hosts, options={})
8383
if name == :all
84-
raise ArgumentError.new("#{name} reserved name for role. Please choose another name")
84+
raise ArgumentError, "#{name} reserved name for role. Please choose another name"
8585
end
8686

8787
servers.add_role(name, hosts, options)
@@ -179,7 +179,7 @@ def callable_without_parameters?(x)
179179

180180
def invoke_validations(key, value, &block)
181181
unless value.nil? or block.nil?
182-
raise Capistrano::ValidationError.new("Value and block both passed to Configuration#set")
182+
raise Capistrano::ValidationError, "Value and block both passed to Configuration#set"
183183
end
184184

185185
return unless validators.key? key

lib/capistrano/scm.rb

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,7 @@ def fetch(*args)
5858
# @return [Boolean]
5959
#
6060
def test
61-
raise NotImplementedError.new(
62-
"Your SCM strategy module should provide a #test method"
63-
)
61+
raise NotImplementedError, "Your SCM strategy module should provide a #test method"
6462
end
6563

6664
# @abstract
@@ -71,9 +69,7 @@ def test
7169
# @return [Boolean]
7270
#
7371
def check
74-
raise NotImplementedError.new(
75-
"Your SCM strategy module should provide a #check method"
76-
)
72+
raise NotImplementedError, "Your SCM strategy module should provide a #check method"
7773
end
7874

7975
# @abstract
@@ -83,9 +79,7 @@ def check
8379
# @return void
8480
#
8581
def clone
86-
raise NotImplementedError.new(
87-
"Your SCM strategy module should provide a #clone method"
88-
)
82+
raise NotImplementedError, "Your SCM strategy module should provide a #clone method"
8983
end
9084

9185
# @abstract
@@ -95,9 +89,7 @@ def clone
9589
# @return void
9690
#
9791
def update
98-
raise NotImplementedError.new(
99-
"Your SCM strategy module should provide a #update method"
100-
)
92+
raise NotImplementedError, "Your SCM strategy module should provide a #update method"
10193
end
10294

10395
# @abstract
@@ -107,9 +99,7 @@ def update
10799
# @return void
108100
#
109101
def release
110-
raise NotImplementedError.new(
111-
"Your SCM strategy module should provide a #release method"
112-
)
102+
raise NotImplementedError, "Your SCM strategy module should provide a #release method"
113103
end
114104

115105
# @abstract
@@ -119,9 +109,7 @@ def release
119109
# @return void
120110
#
121111
def fetch_revision
122-
raise NotImplementedError.new(
123-
"Your SCM strategy module should provide a #fetch_revision method"
124-
)
112+
raise NotImplementedError, "Your SCM strategy module should provide a #fetch_revision method"
125113
end
126114
end
127115
end

0 commit comments

Comments
 (0)