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

Fix FieldDefinitions autocorrection for fields with squished heredocs #164

Merged

Conversation

fatkodima
Copy link
Contributor

FieldDefinitions fails to correctly autocorrect in the following case:

class UserType < BaseType
  field :first_name, String, null: true, description: <<~DESC.squish
    First name.
  DESC
  field :last_name, String, null: true

  def last_name
    object.contact_data.last_name
  end

  def first_name
    object.contact_data.first_name
  end
end

It autocorrects to:

class UserType < BaseType
  field :first_name, String, null: true, description: <<~DESC.squish

  def first_name
    object.contact_data.first_name
  end

    First name.
  DESC
  field :last_name, String, null: true

  def last_name
    object.contact_data.last_name
  end
end

Copy link
Owner

@DmitryTsepelev DmitryTsepelev left a comment

Choose a reason for hiding this comment

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

🫡

@DmitryTsepelev DmitryTsepelev merged commit 3b8016f into DmitryTsepelev:master Jun 19, 2024
13 checks passed
@fatkodima fatkodima deleted the field_definitions-heredocs branch June 19, 2024 18:09
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