Skip to content

Also disable Style/MethodCallWithoutArgsParentheses - #5

Merged
reese merged 1 commit into
reese:mainfrom
dduugg:disable-method-call-without-args-parentheses
Sep 9, 2026
Merged

reese merged 1 commit into
reese:mainfrom
dduugg:disable-method-call-without-args-parentheses

Conversation

@dduugg

@dduugg dduugg commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

rubyfmt appends () to a receiver-qualified no-arg call when a local variable shares the method's name, so that the call stays a call rather than resolving to the variable (playground). Style/MethodCallWithoutArgsParentheses removes exactly those parens, so the two autocorrects revert each other indefinitely.

Reported in #3, where you noted it makes sense to disable. I hit it independently on a Rails app: policy_violations = ... self.policy_violations(), where the local really does shadow the method. Verified by autocorrecting that one cop against a rubyfmt-clean tree and re-running rubyfmt --check, which then fails.

Left Style/IfUnlessModifier from that issue alone — it sounded like it's headed for full.yml, and @tsukkee offered to pick it up.

@reese

reese commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Thanks!

@reese
reese merged commit 2bad64b into reese:main Sep 9, 2026
4 checks passed
@dduugg
dduugg deleted the disable-method-call-without-args-parentheses branch September 9, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants