ruby-syntax-tree / syntax_tree

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

Plugin for not switching to `%w`/`%i` array syntax #405

Closed maxnotarangelo closed 1 year ago

maxnotarangelo commented 1 year ago

Would you be open to a PR for a plugin that did either of the two things below?

  1. Left the existing %w[a b ...] or ["a", "b", ...] formatting, however it was originally (and the equivalent for %i[...])
  2. Always formatted arrays of strings/symbols without the %w/%i syntax

From what I could tell, (1) seems pretty easy; commenting out the following lines seemed to do it for me: https://github.com/ruby-syntax-tree/syntax_tree/blob/db51d38ce94e038125ff2597cc58f3646056bf6d/lib/syntax_tree/node.rb#L1197-L1205

kddnewton commented 1 year ago

This is one of those things that I don't want a plugin for. It's such a tight rope to walk, but I really don't want to add plugins unless I absolutely have to, because it just leads to fragmentation/arguments. Sorry.