Skip to content

Improve multiline T.must autocorrection - #40

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

Improve multiline T.must autocorrection#40
Morriar wants to merge 1 commit into
fix/prefer-not-nil-index-parenthesesfrom
fix/prefer-not-nil-multiline-receiver

Conversation

@Morriar

@Morriar Morriar commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

TypeToolkit/PreferNotNil preserves the T.must parentheses whenever the call spans multiple lines, even when only the argument itself is multiline. This causes:

T.must(foo
  .bar)

to autocorrect to:

(foo
  .bar).not_nil!

instead of:

foo
  .bar.not_nil!

Multiline command-style calls can also crash because they do not have parenthesis locations:

T.must foo
  .bar

This change distinguishes multiline arguments from multiline wrappers and handles calls without parentheses.

@Morriar
Morriar force-pushed the fix/prefer-not-nil-multiline-receiver branch from 574716e to 753a4a0 Compare August 20, 2026 20:08
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