diff --git a/.github/workflows/check_changelog.yml b/.github/workflows/check_changelog.yml index 508cbfe..c5636ec 100644 --- a/.github/workflows/check_changelog.yml +++ b/.github/workflows/check_changelog.yml @@ -13,7 +13,7 @@ jobs: !contains(github.event.pull_request.body, '[skip ci]') && !contains(github.event.pull_request.labels.*.name, 'skip changelog') steps: - - uses: actions/checkout@v4.1.1 + - uses: actions/checkout@v4.2.1 - name: Check that CHANGELOG is touched run: | git fetch origin ${{ github.base_ref }} --depth 1 && \ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da7b0f3..98e8cc4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.2.1 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -34,7 +34,7 @@ jobs: ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} steps: - name: Checkout code - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.2.1 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -53,7 +53,7 @@ jobs: ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }} steps: - name: Checkout code - uses: actions/checkout@v4.1.1 + uses: actions/checkout@v4.2.1 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/.gitignore b/.gitignore index 192d9af..953c12e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,8 +7,8 @@ /spec/reports/ /tmp/ scratch.rb +/*.lock # rspec failure tracking .rspec_status .DS_Store - diff --git a/CHANGELOG.md b/CHANGELOG.md index 894ca47..4837807 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## HEAD (unreleased) +## 2.0.1 + +- Fix CLI failure when shipped with default gems. (https://github.com/ruby/syntax_suggest/pull/226 and https://github.com/ruby/syntax_suggest/pull/227) + ## 2.0.0 - Changed: No longer supports EOL versions of Ruby. (https://github.com/ruby/syntax_suggest/pull/210) diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 83a55d8..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,85 +0,0 @@ -PATH - remote: . - specs: - syntax_suggest (2.0.0) - -GEM - remote: https://rubygems.org/ - specs: - ast (2.4.2) - benchmark-ips (2.12.0) - diff-lcs (1.5.0) - json (2.7.0) - language_server-protocol (3.17.0.3) - lint_roller (1.1.0) - parallel (1.23.0) - parser (3.2.2.4) - ast (~> 2.4.1) - racc - prism (0.18.0) - racc (1.7.3) - rainbow (3.1.1) - rake (12.3.3) - regexp_parser (2.8.3) - rexml (3.2.6) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-support (3.12.1) - rubocop (1.57.2) - json (~> 2.3) - language_server-protocol (>= 3.17.0) - parallel (~> 1.10) - parser (>= 3.2.2.4) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - ruby-prof (1.6.3) - ruby-progressbar (1.13.0) - stackprof (0.2.25) - standard (1.32.1) - language_server-protocol (~> 3.17.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.57.2) - standard-custom (~> 1.0.0) - standard-performance (~> 1.2) - standard-custom (1.0.2) - lint_roller (~> 1.0) - rubocop (~> 1.50) - standard-performance (1.2.1) - lint_roller (~> 1.1) - rubocop-performance (~> 1.19.1) - unicode-display_width (2.5.0) - -PLATFORMS - ruby - -DEPENDENCIES - benchmark-ips - prism - rake (~> 12.0) - rspec (~> 3.0) - ruby-prof - stackprof - standard - syntax_suggest! - -BUNDLED WITH - 2.4.21 diff --git a/exe/syntax_suggest b/exe/syntax_suggest index e4a0b0b..3dc8eb9 100755 --- a/exe/syntax_suggest +++ b/exe/syntax_suggest @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require_relative "../lib/syntax_suggest/api" +require "syntax_suggest/api" SyntaxSuggest::Cli.new( argv: ARGV diff --git a/lib/syntax_suggest/around_block_scan.rb b/lib/syntax_suggest/around_block_scan.rb index ce00431..dd9af72 100644 --- a/lib/syntax_suggest/around_block_scan.rb +++ b/lib/syntax_suggest/around_block_scan.rb @@ -118,7 +118,7 @@ def scan_while end # Scanning is intentionally conservative because - # we have no way of rolling back an agressive block (at this time) + # we have no way of rolling back an aggressive block (at this time) # # If a block was stopped for some trivial reason, (like an empty line) # but the next line would have caused it to be balanced then we @@ -224,7 +224,7 @@ def lines @scanner.lines end - # Managable rspec errors + # Manageable rspec errors def inspect "#<#{self.class}:0x0000123843lol >" end diff --git a/lib/syntax_suggest/block_expand.rb b/lib/syntax_suggest/block_expand.rb index e9b486c..2751ae2 100644 --- a/lib/syntax_suggest/block_expand.rb +++ b/lib/syntax_suggest/block_expand.rb @@ -157,7 +157,7 @@ def expand_neighbors(block) end end - # Managable rspec errors + # Manageable rspec errors def inspect "#" end diff --git a/lib/syntax_suggest/capture_code_context.rb b/lib/syntax_suggest/capture_code_context.rb index 6dc7047..1f232cf 100644 --- a/lib/syntax_suggest/capture_code_context.rb +++ b/lib/syntax_suggest/capture_code_context.rb @@ -26,7 +26,7 @@ module SyntaxSuggest # they can't add extra data that's not present. # # In the case of known ambiguious cases, this class adds context - # back to the ambiguitiy so the programmer has full information. + # back to the ambiguity so the programmer has full information. # # Beyond handling these ambiguities, it also captures surrounding # code context information: diff --git a/lib/syntax_suggest/clean_document.rb b/lib/syntax_suggest/clean_document.rb index 0847a62..2790cca 100644 --- a/lib/syntax_suggest/clean_document.rb +++ b/lib/syntax_suggest/clean_document.rb @@ -267,7 +267,7 @@ def join_groups(groups) groups.each do |lines| line = lines.first - # Handle the case of multiple groups in a a row + # Handle the case of multiple groups in a row # if one is already replaced, move on next if @document[line.index].empty? diff --git a/lib/syntax_suggest/lex_value.rb b/lib/syntax_suggest/lex_value.rb index 008cc10..b46a332 100644 --- a/lib/syntax_suggest/lex_value.rb +++ b/lib/syntax_suggest/lex_value.rb @@ -28,7 +28,7 @@ def initialize(line, type, token, state, last_lex = nil) @is_end = false @is_kw = false return if type != :on_kw - # + return if last_lex && last_lex.fname? # https://github.com/ruby/ruby/commit/776759e300e4659bb7468e2b97c8c2d4359a2953 case token diff --git a/lib/syntax_suggest/parse_blocks_from_indent_line.rb b/lib/syntax_suggest/parse_blocks_from_indent_line.rb index 241ed6a..39dfca5 100644 --- a/lib/syntax_suggest/parse_blocks_from_indent_line.rb +++ b/lib/syntax_suggest/parse_blocks_from_indent_line.rb @@ -8,7 +8,7 @@ module SyntaxSuggest # grabbing one that contains only an "end". In this example: # # def dog - # begonn # mispelled `begin` + # begonn # misspelled `begin` # puts "bark" # end # end diff --git a/lib/syntax_suggest/version.rb b/lib/syntax_suggest/version.rb index 4320adb..d5eff2a 100644 --- a/lib/syntax_suggest/version.rb +++ b/lib/syntax_suggest/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module SyntaxSuggest - VERSION = "2.0.0" + VERSION = "2.0.1" end diff --git a/spec/unit/block_expand_spec.rb b/spec/unit/block_expand_spec.rb index 5cff736..fde0360 100644 --- a/spec/unit/block_expand_spec.rb +++ b/spec/unit/block_expand_spec.rb @@ -146,7 +146,7 @@ def foo EOM end - it "expand until next boundry (indentation)" do + it "expand until next boundary (indentation)" do source_string = <<~EOM describe "what" do Foo.call @@ -188,7 +188,7 @@ def foo EOM end - it "expand until next boundry (empty lines)" do + it "expand until next boundary (empty lines)" do source_string = <<~EOM describe "what" do end diff --git a/spec/unit/clean_document_spec.rb b/spec/unit/clean_document_spec.rb index c531c19..5b5ca04 100644 --- a/spec/unit/clean_document_spec.rb +++ b/spec/unit/clean_document_spec.rb @@ -139,7 +139,7 @@ module SyntaxSuggest source = <<~'EOM' context "timezones workaround" do it "should receive a time in UTC format and return the time with the"\ - "office's UTC offset substracted from it" do + "office's UTC offset subtracted from it" do travel_to DateTime.new(2020, 10, 1, 10, 0, 0) do office = build(:office) end @@ -155,7 +155,7 @@ module SyntaxSuggest ).to eq(<<~'EOM'.indent(2)) 1 context "timezones workaround" do 2 it "should receive a time in UTC format and return the time with the"\ - 3 "office's UTC offset substracted from it" do + 3 "office's UTC offset subtracted from it" do 4 travel_to DateTime.new(2020, 10, 1, 10, 0, 0) do 5 office = build(:office) 6 end @@ -171,7 +171,7 @@ module SyntaxSuggest ).to eq(<<~'EOM') 1 context "timezones workaround" do > 2 it "should receive a time in UTC format and return the time with the"\ - > 3 "office's UTC offset substracted from it" do + > 3 "office's UTC offset subtracted from it" do 4 travel_to DateTime.new(2020, 10, 1, 10, 0, 0) do 5 office = build(:office) 6 end