Skip to content

Commit b9f5cdd

Browse files
soutaroclaude
andcommitted
Deprecate preserve: parameter in annotate_file
Rewriter always preserves formatting, so preserve: is no longer needed. Default it to true and mark the overload with preserve: as deprecated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d1adf91 commit b9f5cdd

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/rbs/annotate/rdoc_annotator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def initialize(source:)
1313
@include_filename = true
1414
end
1515

16-
def annotate_file(path, preserve:)
16+
def annotate_file(path, preserve: true)
1717
buffer, _, decls = Parser.parse_signature(path.read())
1818

1919
rewriter = Rewriter.new(buffer)

sig/annotate/rdoc_annotater.rbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module RBS
88

99
def initialize: (source: RDocSource) -> void
1010

11-
def annotate_file: (Pathname, preserve: bool) -> void
11+
def annotate_file: (Pathname) -> void
12+
| %a{deprecated: it preserves the format by default} (Pathname, preserve: bool) -> void
1213

1314
def annotate_decls: (Array[AST::Declarations::t], Rewriter, ?outer: Array[Namespace]) -> void
1415

0 commit comments

Comments
 (0)