From 82bab149162b86f8f333fa312198c33eeabb7a5a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 18:08:04 +0000 Subject: [PATCH 1/2] Bump actions/deploy-pages from 1 to 2 Bumps [actions/deploy-pages](https://github.com/actions/deploy-pages) from 1 to 2. - [Release notes](https://github.com/actions/deploy-pages/releases) - [Commits](https://github.com/actions/deploy-pages/compare/v1...v2) --- updated-dependencies: - dependency-name: actions/deploy-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/gh-pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 6c64676d..5b662631 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -51,4 +51,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v2 From 491b86de38462ddcf0c6a34e51f007c6d9dfcf27 Mon Sep 17 00:00:00 2001 From: Kevin Newton Date: Tue, 21 Mar 2023 09:46:05 -0400 Subject: [PATCH 2/2] Bump to version 6.1.1 --- CHANGELOG.md | 6 ++++++ Gemfile.lock | 2 +- lib/syntax_tree/node.rb | 6 +++--- lib/syntax_tree/version.rb | 2 +- test/fixtures/call.rb | 7 +++++++ 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d3daa58..273d4003 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +## [6.1.1] - 2023-03-21 + +### Changed + +- Fixed a bug where the call chain formatter was incorrectly looking at call messages. + ## [6.1.0] - 2023-03-20 ### Added diff --git a/Gemfile.lock b/Gemfile.lock index f69c40d1..ad2aeaa5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - syntax_tree (6.1.0) + syntax_tree (6.1.1) prettier_print (>= 1.2.0) GEM diff --git a/lib/syntax_tree/node.rb b/lib/syntax_tree/node.rb index 3f013b31..54d132e6 100644 --- a/lib/syntax_tree/node.rb +++ b/lib/syntax_tree/node.rb @@ -2824,7 +2824,7 @@ def format_chain(q, children) if (receiver = child.receiver).is_a?(CallNode) && (receiver.message != :call) && (receiver.message.value == "where") && - (message.value == "not") + (child.message != :call && child.message.value == "not") # This is very specialized behavior wherein we group # .where.not calls together because it looks better. For more # information, see @@ -2848,8 +2848,8 @@ def format_chain(q, children) # If the parent call node has a comment on the message then we need # to print the operator trailing in order to keep it working. last_child = children.last - if last_child.is_a?(CallNode) && last_child.message.comments.any? && - last_child.operator + if last_child.is_a?(CallNode) && last_child.message != :call && + last_child.message.comments.any? && last_child.operator q.format(CallOperatorFormatter.new(last_child.operator)) skip_operator = true else diff --git a/lib/syntax_tree/version.rb b/lib/syntax_tree/version.rb index 3ed889e4..ad87d3e1 100644 --- a/lib/syntax_tree/version.rb +++ b/lib/syntax_tree/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module SyntaxTree - VERSION = "6.1.0" + VERSION = "6.1.1" end diff --git a/test/fixtures/call.rb b/test/fixtures/call.rb index d35c6036..eec717f0 100644 --- a/test/fixtures/call.rb +++ b/test/fixtures/call.rb @@ -65,3 +65,10 @@ =begin =end to_s +% +fooooooooooooooooooooooooooooooooooo.barrrrrrrrrrrrrrrrrrrrrrrrrrrrrr.where.not(:id).order(:id) +- +fooooooooooooooooooooooooooooooooooo + .barrrrrrrrrrrrrrrrrrrrrrrrrrrrrr + .where.not(:id) + .order(:id)