rfmt 1.4.1-aarch64-linux → 1.5.1-aarch64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 10e7b13d30190bce650dae32a9ff9a0c3335d29b1cce920f760071baaa88e197
4
- data.tar.gz: 4c825298f47c9305dfdaff2ae94be1de0335aa924638b5d54685e183e721e069
3
+ metadata.gz: e5abf1bc063954128b9ac63d381f1626d70cc3dfadc22c47f65419b2b1013af5
4
+ data.tar.gz: e8f877f7aac68f8ab709a668d4cdb79e6abc2d5f8df52d140f1b278a8b2df75f
5
5
  SHA512:
6
- metadata.gz: 751019a2b31b975a5f88d958833d319dda6e8befb25f83a12e525c0396d500fa4284751ed20cc388798a363db1ccd974b2d6fcd1aa6ef8af13a60ef883e65785
7
- data.tar.gz: fc69e55c9a333f8b89e48a7d158817e17d5babf93d690ebb14085f181acf808d987d1815fda148259ab4ea19361ab01e70b09484daa460a165e81994cffbde45
6
+ metadata.gz: e4b93e44a1eec6bb836bbec52d00683a3698a22cbb06955444ccad7f26615121a97caa3083b88588e23e0a6a1bbdc54dbd17cdb2d05bd4099ab4f7d51fd2db89
7
+ data.tar.gz: f43b80d6aaae0368ca1420446d78634d31bad07fed22f1a0566327257f8342052476506e200f61d966ae2538a28b4ba77928e601473a41d40e1c5ac451d81e28
data/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.5.1] - 2026-02-21
4
+
5
+ ### Fixed
6
+ - Fix inline modifier `if`/`unless` formatting (#87)
7
+ - Fix heredoc command incorrectly removed (#90, #86)
8
+ - Fix method chain command dependency handling (#89, #85)
9
+
10
+ ### Added
11
+ - Heredoc comment deletion support
12
+ - Place block loop emission support
13
+
14
+ ### Changed
15
+ - Update README.md
16
+ - Code formatting improvements (RuboCop compliance)
17
+
18
+ ## [1.5.0] - 2026-01-25
19
+
20
+ ### Added
21
+ - Docker Compose test environment setup (#84)
22
+ - Support for `then` expression emission (#80)
23
+ - CI support for Ruby 3.4 and Ruby 4 (#82)
24
+
25
+ ### Changed
26
+ - Upgrade Magnus (Rust-Ruby FFI library) (#83)
27
+ - Optimize Docker build with multi-stage and caching (#84)
28
+ - Upgrade unicode-emoji dependency
29
+
30
+ ### Fixed
31
+ - Preserve heredoc content and closing identifier (#81)
32
+ - Fix `rescue`/`ensure` clauses being deleted inside `do...end` blocks (#78)
33
+ - Fix inline comment node handling (#77)
34
+ - Fix BTreeMap range error (Issue #71)
35
+
3
36
  ## [1.4.1] - 2026-01-17
4
37
 
5
38
  ### Fixed
data/README.md CHANGED
@@ -23,6 +23,7 @@ A Ruby code formatter written in Rust
23
23
  ## What is rfmt?
24
24
 
25
25
  [RubyGems reference](https://rubygems.org/gems/rfmt)
26
+ [DeepWiki rfmt](https://deepwiki.com/fs0414/rfmt)
26
27
 
27
28
  **rfmt** is a Ruby code formatter that enforces consistent style across your codebase. Key characteristics:
28
29
 
data/lib/rfmt/3.3/rfmt.so CHANGED
Binary file
Binary file
@@ -108,16 +108,69 @@ module Rfmt
108
108
  # Extract location information from node
109
109
  def self.extract_location(node)
110
110
  loc = node.location
111
+
112
+ # For heredoc nodes, the location only covers the opening tag (<<~CSV)
113
+ # We need to find the maximum end_offset including closing_loc
114
+ end_offset = loc.end_offset
115
+ end_line = loc.end_line
116
+ end_column = loc.end_column
117
+
118
+ # Check this node's closing_loc
119
+ if node.respond_to?(:closing_loc) && node.closing_loc
120
+ closing = node.closing_loc
121
+ if closing.end_offset > end_offset
122
+ end_offset = closing.end_offset
123
+ end_line = closing.end_line
124
+ end_column = closing.end_column
125
+ end
126
+ end
127
+
128
+ # Recursively check all descendant nodes for heredoc closing_loc
129
+ # Issue #74: handled direct children (e.g., LocalVariableWriteNode -> StringNode)
130
+ # Issue #86: handles deeper nesting (e.g., CallNode -> ArgumentsNode -> StringNode)
131
+ max_closing = find_max_closing_loc_recursive(node)
132
+ if max_closing && max_closing[:end_offset] > end_offset
133
+ end_offset = max_closing[:end_offset]
134
+ end_line = max_closing[:end_line]
135
+ end_column = max_closing[:end_column]
136
+ end
137
+
111
138
  {
112
139
  start_line: loc.start_line,
113
140
  start_column: loc.start_column,
114
- end_line: loc.end_line,
115
- end_column: loc.end_column,
141
+ end_line: end_line,
142
+ end_column: end_column,
116
143
  start_offset: loc.start_offset,
117
- end_offset: loc.end_offset
144
+ end_offset: end_offset
118
145
  }
119
146
  end
120
147
 
148
+ # Recursively find the maximum closing_loc among all descendant nodes
149
+ # Returns nil if no closing_loc found, otherwise { end_offset:, end_line:, end_column: }
150
+ def self.find_max_closing_loc_recursive(node, depth: 0)
151
+ return nil if depth > 10
152
+
153
+ max_closing = nil
154
+
155
+ node.child_nodes.compact.each do |child|
156
+ if child.respond_to?(:closing_loc) && child.closing_loc
157
+ closing = child.closing_loc
158
+ if max_closing.nil? || closing.end_offset > max_closing[:end_offset]
159
+ max_closing = {
160
+ end_offset: closing.end_offset,
161
+ end_line: closing.end_line,
162
+ end_column: closing.end_column
163
+ }
164
+ end
165
+ end
166
+
167
+ child_max = find_max_closing_loc_recursive(child, depth: depth + 1)
168
+ max_closing = child_max if child_max && (max_closing.nil? || child_max[:end_offset] > max_closing[:end_offset])
169
+ end
170
+
171
+ max_closing
172
+ end
173
+
121
174
  # Extract child nodes
122
175
  def self.extract_children(node)
123
176
  children = []
@@ -176,6 +229,7 @@ module Rfmt
176
229
  [
177
230
  node.statements,
178
231
  node.rescue_clause,
232
+ node.else_clause,
179
233
  node.ensure_clause
180
234
  ].compact
181
235
  when Prism::EnsureNode
data/lib/rfmt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rfmt
4
- VERSION = '1.4.1'
4
+ VERSION = '1.5.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rfmt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.5.1
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - fujitani sora
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-01-17 00:00:00.000000000 Z
11
+ date: 2026-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs
@@ -65,9 +65,8 @@ files:
65
65
  - README.md
66
66
  - exe/rfmt
67
67
  - lib/rfmt.rb
68
- - lib/rfmt/3.1/rfmt.so
69
- - lib/rfmt/3.2/rfmt.so
70
68
  - lib/rfmt/3.3/rfmt.so
69
+ - lib/rfmt/3.4/rfmt.so
71
70
  - lib/rfmt/cache.rb
72
71
  - lib/rfmt/cli.rb
73
72
  - lib/rfmt/configuration.rb
@@ -94,10 +93,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
93
  requirements:
95
94
  - - ">="
96
95
  - !ruby/object:Gem::Version
97
- version: '3.1'
96
+ version: '3.3'
98
97
  - - "<"
99
98
  - !ruby/object:Gem::Version
100
- version: 3.4.dev
99
+ version: 3.5.dev
101
100
  required_rubygems_version: !ruby/object:Gem::Requirement
102
101
  requirements:
103
102
  - - ">="
data/lib/rfmt/3.1/rfmt.so DELETED
Binary file
data/lib/rfmt/3.2/rfmt.so DELETED
Binary file