Title: Non-stable formatting with a multi-line comment in a method chain · Issue #1420 · prettier/plugin-ruby · GitHub
Open Graph Title: Non-stable formatting with a multi-line comment in a method chain · Issue #1420 · prettier/plugin-ruby
X Title: Non-stable formatting with a multi-line comment in a method chain · Issue #1420 · prettier/plugin-ruby
Description: Using prettier 3.2.4 and version 4.0.4 of @pretter/plugin-ruby The following code snippet: invites = Invite .where(id: invite_ids) .where(redeemed_at: nil) # this is a # multi-line-comment .limit(20) Gets formatted as: invites = Invite ....
Open Graph Description: Using prettier 3.2.4 and version 4.0.4 of @pretter/plugin-ruby The following code snippet: invites = Invite .where(id: invite_ids) .where(redeemed_at: nil) # this is a # multi-line-comment .limit(2...
X Description: Using prettier 3.2.4 and version 4.0.4 of @pretter/plugin-ruby The following code snippet: invites = Invite .where(id: invite_ids) .where(redeemed_at: nil) # this is a # multi-line-comment .limit(2...
Opengraph URL: https://github.com/prettier/plugin-ruby/issues/1420
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Non-stable formatting with a multi-line comment in a method chain","articleBody":"Using prettier 3.2.4 and version 4.0.4 of @pretter/plugin-ruby\r\n\r\nThe following code snippet:\r\n\r\n```\r\ninvites =\r\n Invite\r\n .where(id: invite_ids)\r\n .where(redeemed_at: nil)\r\n # this is a\r\n # multi-line-comment\r\n .limit(20)\r\n```\r\n\r\nGets formatted as:\r\n\r\n```\r\ninvites =\r\n Invite\r\n .where(id: invite_ids)\r\n .where(redeemed_at: nil)# this is a\r\n # multi-line-comment\r\n .\r\n limit(20)\r\n```\r\n\r\nHowever, this formatting is unstable. When formatting is applied again, it changes to:\r\n\r\n```\r\ninvites =\r\n Invite\r\n .where(id: invite_ids)\r\n .where(redeemed_at: nil) # this is a# multi-line-comment\r\n .\r\n limit(20)\r\n```\r\n\r\nAnd then an additional round of formatting results in:\r\n\r\n```\r\ninvites =\r\n Invite\r\n .where(id: invite_ids)\r\n .where(redeemed_at: nil) # this is a# multi-line-comment\r\n .limit(20)\r\n```\r\n\r\nWhich is finally stable.\r\n\r\nIn particular, I hit this when upgrading my codebase from version 1.6.1 of @pretter-plugin-ruby.\r\n\r\nThe original formatting seems the best?","author":{"url":"https://github.com/mharris-figma","@type":"Person","name":"mharris-figma"},"datePublished":"2024-01-24T17:18:36.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/1420/plugin-ruby/issues/1420"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2e8c8b0b-8a7a-e437-3bed-c5df038572f2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 869E:125966:1BFF2:22FBE:698D0578 |
| html-safe-nonce | bf5dcbb399bde85b5783f39ed441b12953fc8d5643d0881b8660e9626576a7be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjlFOjEyNTk2NjoxQkZGMjoyMkZCRTo2OThEMDU3OCIsInZpc2l0b3JfaWQiOiI0NzM3NDgxNzMzOTQyNjA5MjcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 74d81c1b0c5d3b0cb2297b010610b11492822a4fc99103f5f28d8d2e89561c97 |
| hovercard-subject-tag | issue:2098736304 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/prettier/plugin-ruby/1420/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5d2fd08316248b494e613c890dc37493958d093db1774b995874166f73df8fd4/prettier/plugin-ruby/issues/1420 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5d2fd08316248b494e613c890dc37493958d093db1774b995874166f73df8fd4/prettier/plugin-ruby/issues/1420 |
| og:image:alt | Using prettier 3.2.4 and version 4.0.4 of @pretter/plugin-ruby The following code snippet: invites = Invite .where(id: invite_ids) .where(redeemed_at: nil) # this is a # multi-line-comment .limit(2... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mharris-figma |
| hostname | github.com |
| expected-hostname | github.com |
| None | f2da95634bce8a94cfa4123788169bfabdf845fd1d790fbaaaaab09dcfebdf28 |
| turbo-cache-control | no-preview |
| go-import | github.com/prettier/plugin-ruby git https://github.com/prettier/plugin-ruby.git |
| octolytics-dimension-user_id | 25822731 |
| octolytics-dimension-user_login | prettier |
| octolytics-dimension-repository_id | 134440972 |
| octolytics-dimension-repository_nwo | prettier/plugin-ruby |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 134440972 |
| octolytics-dimension-repository_network_root_nwo | prettier/plugin-ruby |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c21843b18feba17d11efb1895a7db61e8672f2cf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width