Skip to content
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

feat: implement remove newlines in brackets before toggle block to on… #3005

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hungle2911
Copy link
Contributor

Motivation

Close #2968
The current block conversion from do..end to brackets fails when handling complex data structures like Hashes or Arrays. Simply converting line breaks to semicolons doesn't maintain code validity in these cases.

Implementation

  • Added remove_newlines_in_brackets method to properly handle newlines within Hash/Array literals

Automated Tests

  1. test_toggle_block_do_end_to_brackets: Verifies basic block conversion functionality
  2. test_toggle_block_do_end_with_hash_to_brackets: Ensures proper handling of Hash literals within blocks

@Hungle2911 Hungle2911 requested a review from a team as a code owner January 2, 2025 23:31
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.

Switch block style refactoring needs improvement
1 participant