-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
Style/AccessModifierDeclarations
disabled by default
Follow up of #5953, #6032 I think it is too difficult to enforce `group` (default) style by default because it doesn't work for some methods. For example, `def_delegator` doesn't work when using `group` style: ```ruby require 'forwardable' class Cat def meow puts "Meow!" end end class CatCage extend Forwardable def initialize(cat) @cat = cat end private def_delegator :@cat, :meow end ``` ``` [8] pry(main)> CatCage.new(Cat.new).meow Meow! => nil ``` This is because `def_delegator` defines a method by `self.module_eval`. Forcing group styles by default may be misleading for the above problems. Maybe it is needed to add such methods to the whitelist and exclude them from inspection, but it seems to be difficult for me. First of all, I think it should make this cop disabled by default and help users confused by this cop. WDYT? @brandonweiss
- Loading branch information
Showing
4 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters