diff --git a/.rubocop.yml b/.rubocop.yml index c1c17001..2142296f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,7 +7,7 @@ AllCops: SuggestExtensions: false TargetRubyVersion: 2.7 Exclude: - - '{.git,.github,bin,coverage,pkg,sorbet,spec,test/fixtures,vendor,tmp}/**/*' + - '{.git,.github,.ruby-lsp,bin,coverage,doc,pkg,sorbet,spec,test/fixtures,vendor,tmp}/**/*' - test.rb Gemspec/DevelopmentDependencies: @@ -154,6 +154,9 @@ Style/ParallelAssignment: Style/PerlBackrefs: Enabled: false +Style/RedundantArrayConstructor: + Enabled: false + Style/SafeNavigation: Enabled: false diff --git a/Gemfile.lock b/Gemfile.lock index 2bd42028..a26c0e17 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,26 +10,30 @@ GEM ast (2.4.2) docile (1.4.0) json (2.6.3) + language_server-protocol (3.17.0.3) minitest (5.18.1) parallel (1.23.0) - parser (3.2.2.1) + parser (3.2.2.3) ast (~> 2.4.1) + racc prettier_print (1.2.1) + racc (1.7.1) rainbow (3.1.1) rake (13.0.6) - regexp_parser (2.8.0) + regexp_parser (2.8.1) rexml (3.2.5) - rubocop (1.51.0) + rubocop (1.54.2) json (~> 2.3) + language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.0.0) + parser (>= 3.2.2.3) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.28.1) + rubocop-ast (1.29.0) parser (>= 3.2.1.0) ruby-progressbar (1.13.0) simplecov (0.22.0) diff --git a/lib/syntax_tree/reflection.rb b/lib/syntax_tree/reflection.rb index aa7b85b6..6955aa21 100644 --- a/lib/syntax_tree/reflection.rb +++ b/lib/syntax_tree/reflection.rb @@ -64,7 +64,7 @@ def inspect class << self def parse(comment) - comment = comment.gsub(/\n/, " ") + comment = comment.gsub("\n", " ") unless comment.start_with?("[") raise "Comment does not start with a bracket: #{comment.inspect}"