Skip to content

Avoid unnecessary multiline parentheses - #42

Open
Morriar wants to merge 1 commit into
fix/prefer-not-nil-block-parenthesesfrom
fix/prefer-not-nil-multiline-parentheses
Open

Avoid unnecessary multiline parentheses#42
Morriar wants to merge 1 commit into
fix/prefer-not-nil-block-parenthesesfrom
fix/prefer-not-nil-multiline-parentheses

Conversation

@Morriar

@Morriar Morriar commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Avoid unnecessary parentheses when autocorrecting multiline T.must calls without comments.

Before:

variant = (
  InventoryItemVariant.preload(:variant).where(inventory_item_id: @inventory_item_id).first!.variant
).not_nil!

After:

variant = InventoryItemVariant.preload(:variant).where(inventory_item_id: @inventory_item_id).first!.variant.not_nil!

Calls containing comments keep the grouped form so comments and internal indentation are preserved.

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.

1 participant