Skip to content

Commit 5afa62a

Browse files
authored
Merge pull request #210 from ruby/schneems/rev-min-version
Bump minimum Ruby version & update standardrb
2 parents 040d4fe + 7375351 commit 5afa62a

17 files changed

+124
-108
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## HEAD (unreleased)
22

3-
- No longer supports EOL versions of Ruby.
3+
- No longer supports EOL versions of Ruby. (https://github.com/ruby/syntax_suggest/pull/210)
44
- Handle Ruby 3.3 new eval source location format (https://github.com/ruby/syntax_suggest/pull/200).
55

66
## 1.1.0

Gemfile.lock

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ GEM
99
ast (2.4.2)
1010
benchmark-ips (2.9.2)
1111
diff-lcs (1.4.4)
12-
parallel (1.21.0)
13-
parser (3.0.2.0)
12+
json (2.7.0)
13+
language_server-protocol (3.17.0.3)
14+
lint_roller (1.1.0)
15+
parallel (1.23.0)
16+
parser (3.2.2.4)
1417
ast (~> 2.4.1)
15-
rainbow (3.0.0)
18+
racc
19+
racc (1.7.3)
20+
rainbow (3.1.1)
1621
rake (12.3.3)
17-
regexp_parser (2.1.1)
18-
rexml (3.2.5)
22+
regexp_parser (2.8.3)
23+
rexml (3.2.6)
1924
rspec (3.10.0)
2025
rspec-core (~> 3.10.0)
2126
rspec-expectations (~> 3.10.0)
@@ -29,27 +34,38 @@ GEM
2934
diff-lcs (>= 1.2.0, < 2.0)
3035
rspec-support (~> 3.10.0)
3136
rspec-support (3.10.0)
32-
rubocop (1.20.0)
37+
rubocop (1.57.2)
38+
json (~> 2.3)
39+
language_server-protocol (>= 3.17.0)
3340
parallel (~> 1.10)
34-
parser (>= 3.0.0.0)
41+
parser (>= 3.2.2.4)
3542
rainbow (>= 2.2.2, < 4.0)
3643
regexp_parser (>= 1.8, < 3.0)
37-
rexml
38-
rubocop-ast (>= 1.9.1, < 2.0)
44+
rexml (>= 3.2.5, < 4.0)
45+
rubocop-ast (>= 1.28.1, < 2.0)
3946
ruby-progressbar (~> 1.7)
40-
unicode-display_width (>= 1.4.0, < 3.0)
41-
rubocop-ast (1.12.0)
42-
parser (>= 3.0.1.1)
43-
rubocop-performance (1.11.5)
47+
unicode-display_width (>= 2.4.0, < 3.0)
48+
rubocop-ast (1.30.0)
49+
parser (>= 3.2.1.0)
50+
rubocop-performance (1.19.1)
4451
rubocop (>= 1.7.0, < 2.0)
4552
rubocop-ast (>= 0.4.0)
4653
ruby-prof (1.4.3)
47-
ruby-progressbar (1.11.0)
54+
ruby-progressbar (1.13.0)
4855
stackprof (0.2.16)
49-
standard (1.3.0)
50-
rubocop (= 1.20.0)
51-
rubocop-performance (= 1.11.5)
52-
unicode-display_width (2.1.0)
56+
standard (1.32.1)
57+
language_server-protocol (~> 3.17.0.2)
58+
lint_roller (~> 1.0)
59+
rubocop (~> 1.57.2)
60+
standard-custom (~> 1.0.0)
61+
standard-performance (~> 1.2)
62+
standard-custom (1.0.2)
63+
lint_roller (~> 1.0)
64+
rubocop (~> 1.50)
65+
standard-performance (1.2.1)
66+
lint_roller (~> 1.1)
67+
rubocop-performance (~> 1.19.1)
68+
unicode-display_width (2.5.0)
5369

5470
PLATFORMS
5571
ruby

lib/syntax_suggest/code_frontier.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def expand?
117117

118118
if ENV["SYNTAX_SUGGEST_DEBUG"]
119119
puts "```"
120-
puts @queue.peek.to_s
120+
puts @queue.peek
121121
puts "```"
122122
puts " @frontier indent: #{frontier_indent}"
123123
puts " @unvisited indent: #{unvisited_indent}"

lib/syntax_suggest/code_search.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class CodeSearch
4343

4444
def initialize(source, record_dir: DEFAULT_VALUE)
4545
record_dir = if record_dir == DEFAULT_VALUE
46-
ENV["SYNTAX_SUGGEST_RECORD_DIR"] || ENV["SYNTAX_SUGGEST_DEBUG"] ? "tmp" : nil
46+
(ENV["SYNTAX_SUGGEST_RECORD_DIR"] || ENV["SYNTAX_SUGGEST_DEBUG"]) ? "tmp" : nil
4747
else
4848
record_dir
4949
end
@@ -73,7 +73,7 @@ def record(block:, name: "record")
7373
if ENV["SYNTAX_SUGGEST_DEBUG"]
7474
puts "\n\n==== #{filename} ===="
7575
puts "\n```#{block.starts_at}..#{block.ends_at}"
76-
puts block.to_s
76+
puts block
7777
puts "```"
7878
puts " block indent: #{block.current_indent}"
7979
end

lib/syntax_suggest/display_invalid_blocks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def initialize(code_lines:, blocks:, io: $stderr, filename: nil, terminal: DEFAU
1414
@filename = filename
1515
@code_lines = code_lines
1616

17-
@terminal = terminal == DEFAULT_VALUE ? io.isatty : terminal
17+
@terminal = (terminal == DEFAULT_VALUE) ? io.isatty : terminal
1818
end
1919

2020
def document_ok?

spec/integration/ruby_command_line_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module SyntaxSuggest
99
Dir.mktmpdir do |dir|
1010
tmpdir = Pathname(dir)
1111
script = tmpdir.join("script.rb")
12-
script.write <<~'EOM'
12+
script.write <<~EOM
1313
puts Kernel.private_methods
1414
EOM
1515

@@ -159,7 +159,7 @@ class Dog
159159
Dir.mktmpdir do |dir|
160160
tmpdir = Pathname(dir)
161161
script = tmpdir.join("script.rb")
162-
script.write <<~'EOM'
162+
script.write <<~EOM
163163
$stderr = STDOUT
164164
eval("def lol")
165165
EOM
@@ -178,7 +178,7 @@ class Dog
178178
Dir.mktmpdir do |dir|
179179
tmpdir = Pathname(dir)
180180
script = tmpdir.join("script.rb")
181-
script.write <<~'EOM'
181+
script.write <<~EOM
182182
break
183183
EOM
184184

spec/integration/syntax_suggest_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ module SyntaxSuggest
2626
debug_display(io.string)
2727
debug_display(benchmark)
2828

29-
expect(io.string).to include(<<~'EOM')
29+
expect(io.string).to include(<<~EOM)
3030
6 class SyntaxTree < Ripper
3131
170 def self.parse(source)
3232
174 end
@@ -54,7 +54,7 @@ module SyntaxSuggest
5454
end
5555

5656
expect(io.string).to_not include("def ruby_install_binstub_path")
57-
expect(io.string).to include(<<~'EOM')
57+
expect(io.string).to include(<<~EOM)
5858
> 1067 def add_yarn_binary
5959
> 1068 return [] if yarn_preinstalled?
6060
> 1069 |
@@ -72,7 +72,7 @@ module SyntaxSuggest
7272
)
7373
debug_display(io.string)
7474

75-
expect(io.string).to include(<<~'EOM')
75+
expect(io.string).to include(<<~EOM)
7676
1 Rails.application.routes.draw do
7777
> 113 namespace :admin do
7878
> 116 match "/foobar(*path)", via: :all, to: redirect { |_params, req|
@@ -91,7 +91,7 @@ module SyntaxSuggest
9191
)
9292
debug_display(io.string)
9393

94-
expect(io.string).to include(<<~'EOM')
94+
expect(io.string).to include(<<~EOM)
9595
1 describe "webmock tests" do
9696
22 it "body" do
9797
27 query = Cutlass::FunctionQuery.new(
@@ -113,7 +113,7 @@ module SyntaxSuggest
113113
)
114114
debug_display(io.string)
115115

116-
expect(io.string).to include(<<~'EOM')
116+
expect(io.string).to include(<<~EOM)
117117
5 module DerailedBenchmarks
118118
6 class RequireTree
119119
> 13 def initialize(name)
@@ -166,7 +166,7 @@ module SyntaxSuggest
166166
end
167167

168168
it "ambiguous end" do
169-
source = <<~'EOM'
169+
source = <<~EOM
170170
def call # 0
171171
print "lol" # 1
172172
end # one # 2
@@ -186,7 +186,7 @@ def call # 0
186186
end
187187

188188
it "simple regression" do
189-
source = <<~'EOM'
189+
source = <<~EOM
190190
class Dog
191191
def bark
192192
puts "woof"
@@ -206,7 +206,7 @@ def bark
206206
end
207207

208208
it "empty else" do
209-
source = <<~'EOM'
209+
source = <<~EOM
210210
class Foo
211211
def foo
212212
if cond?

spec/unit/around_block_scan_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module SyntaxSuggest
66
RSpec.describe AroundBlockScan do
77
it "continues scan from last location even if scan is false" do
8-
source = <<~'EOM'
8+
source = <<~EOM
99
print 'omg'
1010
print 'lol'
1111
print 'haha'

spec/unit/capture/before_after_keyword_ends_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module SyntaxSuggest
66
RSpec.describe Capture::BeforeAfterKeywordEnds do
77
it "before after keyword ends" do
8-
source = <<~'EOM'
8+
source = <<~EOM
99
def nope
1010
print 'not me'
1111
end
@@ -36,7 +36,7 @@ def nada
3636
).call
3737
lines.sort!
3838

39-
expect(lines.join).to include(<<~'EOM')
39+
expect(lines.join).to include(<<~EOM)
4040
def lol
4141
end
4242
def yolo

spec/unit/capture/falling_indent_lines_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
module SyntaxSuggest
66
RSpec.describe Capture::FallingIndentLines do
77
it "on_falling_indent" do
8-
source = <<~'EOM'
8+
source = <<~EOM
99
class OH
1010
def lol
1111
print 'lol
@@ -33,7 +33,7 @@ def yolo
3333
end
3434
lines.sort!
3535

36-
expect(lines.join).to eq(<<~'EOM')
36+
expect(lines.join).to eq(<<~EOM)
3737
class OH
3838
def hello
3939
end

0 commit comments

Comments
 (0)