-
-
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
More fixes #2515
More fixes #2515
Conversation
This looks fine to me, as it's the nest method call is not something that would result in a method argument for the outer method. |
@@ -662,6 +662,12 @@ Style/SingleLineBlockParams: | |||
Style/SingleLineMethods: | |||
AllowIfMethodIsEmpty: true | |||
|
|||
Style/SpecialGlobalVars: | |||
EnforcedStyle: use_verbose_names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say those are "descriptive" and the others are "cryptic". :-)
Let's rename verbose to descriptive or english. I think verbose carries a different connotation.
4bf2731
to
775bf09
Compare
Thanks for all the helpful comments. PR updated. I will probably push several more fixes to this branch over the coming days, but if and when you want to merge it, please go ahead; I can open another one. |
bf8096b
to
2897183
Compare
Apart from the failing build, all changes look good. Your |
f10c5dc
to
209acf5
Compare
…Vars This is for people who like squinting at cryptic variable names and trying to remember what they are for.
It checks for things like: foo(bar 1, 2)
The --stdin CLI option causes RuboCop to read source from stdin. Previously, if this was combined with --autocorrect, an 'infinite loop' error would result. Instead, autocorrect the code and print it to stdout (after an easily-identifiable delimiter which separates it from other information printed to stdout).
If 'attr_writer' appears after an access modifier, that means it's not useless.
…]= are the same Previously, it would flag this: if something array << value else array[index] = value end
…to be 'namespace' Like this: module Info VERSION = '1.2' AUTHOR = 'No-one in particular' end Such classes and modules won't be flagged even if they have no documentation comment.
209acf5
to
8d4d6eb
Compare
Do some major refactoring to ConditionalAssignment at the same time.
…fig from rubocop This is not allowed: inherit_gem: rubocop: config/default.yml ...because it causes confusion. User configuration is ALREADY merged with the default configuration, without explicitly inheriting it like this. Thanks to Jonas Arvidsson for suggesting this.
…exits scope So code like this: if condition raise 'exception' else ok end ...will be flagged. Instead, it should be: raise 'exception' if condition ok
8d4d6eb
to
0594eb8
Compare
Updated PR. Fixed build. Also added one new cop... see the last commit. |
This catches things like: if condition do_x do_z else do_y do_z end ...which should be: if condition do_x else do_y end do_z
66e6977
to
318c056
Compare
I like the new cop - quite useful. |
This is my next batched GH-issue-fixin' PR.
Regarding the new cop requested by @agrimm, which checks for paren-challenged method calls nested inside a paren-privileged method call, what do you think about this:
Is it good, or bad?