ruby-syntax-tree / syntax_tree

Interact with the Ruby syntax tree
https://ruby-syntax-tree.github.io/syntax_tree/
MIT License
571 stars 55 forks source link

v4 changed formatting conflicts with rubocop #174

Closed mscrivo closed 2 years ago

mscrivo commented 2 years ago

Hey Kevin,

Seems that formatting has changed in 4.0, causing conflicts with rubocop rules.

For example:

4.0 wants to change this:

module Migration
  Sequel.migration do
    down do
      DB.run(
        "
        SOME SQL STMT
      "
      )
    end
  end
end

to this:

module Migration
  Sequel.migration do
    down { DB.run("
        SOME SQL STMT
      ") }
  end
end

and rubocop is complaining:

C: [Correctable] Layout/FirstMethodArgumentLineBreak: Add a line break before the first argument of a multi-line method argument list.
      DB.run(" ...

another example with puts:

before:

  puts(
    '
      some string.
    '.gsub(/^\s+/, '')
  )

after:

  puts('
      some string.
    '.gsub(/^\s+/, ''))
kddnewton commented 2 years ago

Oof, that's not right. I'll check.

kddnewton commented 2 years ago

Released in v4.0.1

mscrivo commented 2 years ago

Thank you!