-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cop ColonMethodCall shouldn't forbid constructor like calls #425
Comments
|
That's not how I would interpret it: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/54883 Matz is saying it's not happening before 3.0 at least, but the argument he makes against deprecation is specifically about the exception I'm adding support for here. I'm not against making it optional, but I think it's here to stay. |
Can't argue with that, no option needed :-) I guess you should update the relevant section of the style guide as well. |
this is fixed in the latest rubocop (head), so the current version might still give errors about this. For more information: rubocop/rubocop#425
Ruby has the tradition of adding constructor-like methods to instantiate classes, for instance
Array()
to construct an instance ofArray
. Some libraries offer this as well, like Nokogiri. Their readme suggests using colons, and I do think it makes sense in this case, and should be excepted from the ColonMethodCall:Opinions?
My suggestion would be to allow method calls which start with a capital letter.
The text was updated successfully, but these errors were encountered: