Skip to content

Prevent adding end token on endless methods#4042

Merged
vinistock merged 1 commit intomainfrom
03-31-prevent_adding_end_token_on_endless_methods
Mar 31, 2026
Merged

Prevent adding end token on endless methods#4042
vinistock merged 1 commit intomainfrom
03-31-prevent_adding_end_token_on_endless_methods

Conversation

@vinistock
Copy link
Copy Markdown
Member

@vinistock vinistock commented Mar 31, 2026

Motivation

Working on #4041, I realized that we were incorrectly adding the end token when breaking the line on endless method definitions. This PR prevents that from happening.

Implementation

Just added another check to verify that the def is not followed by an endless method definition.

Automated Tests

Added a test for an invalid syntax case and for a valid one.

Copy link
Copy Markdown
Member Author


How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock self-assigned this Mar 31, 2026
@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Mar 31, 2026
@vinistock vinistock marked this pull request as ready for review March 31, 2026 14:48
@vinistock vinistock requested a review from a team as a code owner March 31, 2026 14:48
@vinistock vinistock requested review from alexcrocha and st0012 March 31, 2026 14:48
Copy link
Copy Markdown
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it add an end for this? (it shouldn't)

def hello = puts(
  "hello"
)

@vinistock vinistock force-pushed the 03-31-prevent_adding_end_token_on_endless_methods branch from 6ad2a91 to f8d31ee Compare March 31, 2026 19:56
@vinistock
Copy link
Copy Markdown
Member Author

That scenario already worked, but I added it as a test case.

@vinistock vinistock requested a review from st0012 March 31, 2026 19:56
@vinistock vinistock merged commit 463836c into main Mar 31, 2026
41 checks passed
@vinistock vinistock deleted the 03-31-prevent_adding_end_token_on_endless_methods branch March 31, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants