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

Remaining prettier formatting fixes #56

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

Merged
merged 13 commits into from
Apr 22, 2022
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