Skip to content

Commit 491b86d

Browse files
committed
Bump to version 6.1.1
1 parent f81c24c commit 491b86d

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

‎CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
66

77
## [Unreleased]
88

9+
## [6.1.1] - 2023-03-21
10+
11+
### Changed
12+
13+
- Fixed a bug where the call chain formatter was incorrectly looking at call messages.
14+
915
## [6.1.0] - 2023-03-20
1016

1117
### Added

‎Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
syntax_tree (6.1.0)
4+
syntax_tree (6.1.1)
55
prettier_print (>= 1.2.0)
66

77
GEM

‎lib/syntax_tree/node.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -2824,7 +2824,7 @@ def format_chain(q, children)
28242824
if (receiver = child.receiver).is_a?(CallNode) &&
28252825
(receiver.message != :call) &&
28262826
(receiver.message.value == "where") &&
2827-
(message.value == "not")
2827+
(child.message != :call && child.message.value == "not")
28282828
# This is very specialized behavior wherein we group
28292829
# .where.not calls together because it looks better. For more
28302830
# information, see
@@ -2848,8 +2848,8 @@ def format_chain(q, children)
28482848
# If the parent call node has a comment on the message then we need
28492849
# to print the operator trailing in order to keep it working.
28502850
last_child = children.last
2851-
if last_child.is_a?(CallNode) && last_child.message.comments.any? &&
2852-
last_child.operator
2851+
if last_child.is_a?(CallNode) && last_child.message != :call &&
2852+
last_child.message.comments.any? && last_child.operator
28532853
q.format(CallOperatorFormatter.new(last_child.operator))
28542854
skip_operator = true
28552855
else

‎lib/syntax_tree/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module SyntaxTree
4-
VERSION = "6.1.0"
4+
VERSION = "6.1.1"
55
end

‎test/fixtures/call.rb

+7
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,10 @@
6565
=begin
6666
=end
6767
to_s
68+
%
69+
fooooooooooooooooooooooooooooooooooo.barrrrrrrrrrrrrrrrrrrrrrrrrrrrrr.where.not(:id).order(:id)
70+
-
71+
fooooooooooooooooooooooooooooooooooo
72+
.barrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
73+
.where.not(:id)
74+
.order(:id)

0 commit comments

Comments
 (0)