From 37e4468d40a1f9525de4e1f2429ffa5739cd5e03 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Wed, 5 Dec 2018 14:10:36 +0900 Subject: [PATCH] Disable Style/RaiseArgs The recommended style `raise RuntimeError, "message"` generally looks better than `raise RuntimeError.new("message")` because it is a variant of `raise "message"` with an explicit exception class supplied. However, when the argument is not a message string, the comma style does not read well because the second argument is not what `raise` would take but is just an argument for the first argument's constructor that's passed through. e.g. ```ruby raise ActiveRecord::RecordInvalid, record ``` So, I'm not in favor of forcing this style unless this cop learns to do the conversion only if the second argument is a string literal. --- config/base.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/base.yml b/config/base.yml index 25205406..2f33111f 100644 --- a/config/base.yml +++ b/config/base.yml @@ -967,9 +967,6 @@ Style/PreferredHashMethods: Style/Proc: Enabled: true -Style/RaiseArgs: - Enabled: true - Style/RandomWithOffset: Enabled: true