- class Ameba::Rule::Style::RedundantParentheses + class Ameba::Rule::Style::ParenthesesAroundCondition

- + @@ -759,7 +759,8 @@ Overview -

A rule that disallows redundant parentheses around control expressions.

+

A rule that checks for the presence of superfluous parentheses +around the condition of if, unless, case,whileanduntil`.

For example, this is considered invalid:

if (foo == 42)
   do_something
@@ -769,10 +770,10 @@
   do_something
 end

YAML configuration example:

-
Style/RedundantParentheses:
+
Style/ParenthesesAroundCondition:
   Enabled: true
   ExcludeTernary: false
-  ExcludeAssignments: false
+ AllowSafeAssignment: false
@@ -813,8 +814,8 @@ - - ameba/rule/style/redundant_parentheses.cr + + ameba/rule/style/parentheses_around_condition.cr
@@ -834,8 +835,13 @@
-
- MSG = "Redundant parentheses" +
+ MSG_MISSING = "Missing parentheses" +
+ + +
+ MSG_REDUNDANT = "Redundant parentheses"
@@ -861,7 +867,7 @@
  • .new(config = nil) -

    A rule that disallows redundant parentheses around control expressions.

    +

    A rule that checks for the presence of superfluous parentheses around the condition of if, unless, case,whileanduntil`.

  • @@ -900,6 +906,16 @@