Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Include %s symbols in no indent
  • Loading branch information
kddnewton committed Apr 22, 2022
commit 1f623a5bccb7728b575d7e32352aa55fa6e8620d
21 changes: 10 additions & 11 deletions lib/syntax_tree/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1042,17 +1042,16 @@ def format(q)
# Determins if the following value should be indented or not.
module AssignFormatting
def self.skip_indent?(value)
(value.is_a?(Call) && skip_indent?(value.receiver)) ||
[
ArrayLiteral,
HashLiteral,
Heredoc,
Lambda,
QSymbols,
QWords,
Symbols,
Words
].include?(value.class)
case value
in ArrayLiteral | HashLiteral | Heredoc | Lambda | QSymbols | QWords | Symbols | Words
true
in Call[receiver:]
skip_indent?(receiver)
in DynaSymbol[quote:]
quote.start_with?("%s")
else
false
end
end
end

Expand Down