config/enabled.yml in rubocop-0.38.0 vs config/enabled.yml in rubocop-0.39.0
- old
+ new
@@ -157,13 +157,10 @@
Description: >-
Use the return value of `if` and `case` statements for
assignment to a variable and variable comparison instead
of assigning that variable inside of each branch.
Enabled: true
- SingleLineConditionsOnly: true
- # Whether the cop should register offenses for conditionals whose branches
- # contain more than one statement a piece
Style/ConstantName:
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
Enabled: true
@@ -322,10 +319,15 @@
Favor modifier if/unless usage when you have a
single-line body.
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
Enabled: true
+Style/IfUnlessModifierOfIfUnless:
+ Description: >-
+ Avoid modifier if/unless usage on conditionals.
+ Enabled: true
+
Style/IfWithSemicolon:
Description: 'Do not use if x; .... Use the ternary operator instead.'
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
Enabled: true
@@ -1171,16 +1173,26 @@
Performance/Count:
Description: >-
Use `count` instead of `select...size`, `reject...size`,
`select...count`, `reject...count`, `select...length`,
and `reject...length`.
+ # This cop has known compatibility issues with `ActiveRecord` and other
+ # frameworks. ActiveRecord's `count` ignores the block that is passed to it.
+ # For more information, see the documentation in the cop itself.
+ # If you understand the known risk, you can disable `SafeMode`.
+ SafeMode: true
Enabled: true
Performance/Detect:
Description: >-
Use `detect` instead of `select.first`, `find_all.first`,
`select.last`, and `find_all.last`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
+ # This cop has known compatibility issues with `ActiveRecord` and other
+ # frameworks. `ActiveRecord` does not implement a `detect` method and `find`
+ # has its own meaning. Correcting `ActiveRecord` methods with this cop
+ # should be considered unsafe.
+ SafeMode: true
Enabled: true
Performance/DoubleStartEndWith:
Description: >-
Use `str.{start,end}_with?(x, ..., y, ...)`