Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5bcf12f

Browse files
committed
Include %s symbols in no indent
1 parent 7a58e81 commit 5bcf12f

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

lib/syntax_tree/node.rb

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,17 +1042,16 @@ def format(q)
10421042
# Determins if the following value should be indented or not.
10431043
module AssignFormatting
10441044
def self.skip_indent?(value)
1045-
(value.is_a?(Call) && skip_indent?(value.receiver)) ||
1046-
[
1047-
ArrayLiteral,
1048-
HashLiteral,
1049-
Heredoc,
1050-
Lambda,
1051-
QSymbols,
1052-
QWords,
1053-
Symbols,
1054-
Words
1055-
].include?(value.class)
1045+
case value
1046+
in ArrayLiteral | HashLiteral | Heredoc | Lambda | QSymbols | QWords | Symbols | Words
1047+
true
1048+
in Call[receiver:]
1049+
skip_indent?(receiver)
1050+
in DynaSymbol[quote:]
1051+
quote.start_with?("%s")
1052+
else
1053+
false
1054+
end
10561055
end
10571056
end
10581057

0 commit comments

Comments
 (0)