From 86e600b2185751c8eccb3b0123f2193077110196 Mon Sep 17 00:00:00 2001 From: Dana Sherson Date: Sat, 25 Nov 2023 17:30:02 +1300 Subject: [PATCH] Update rubocop and friends --- .rubocop.yml | 2 +- Gemfile.lock | 51 ++++++++++--------- lib/path_list/matcher/exact_string.rb | 2 +- .../matcher/exact_string/case_insensitive.rb | 2 +- .../pattern_parser/glob_gitignore.rb | 3 +- path_list.gemspec | 2 +- spec/{ => path_list}/candidate_spec.rb | 0 spec/{ => path_list}/canonical_path_spec.rb | 0 .../gitconfig/core_excludesfile_spec.rb | 0 .../gitconfig/file_parser_spec.rb | 0 .../{ => path_list}/matcher/all/allow_spec.rb | 0 .../matcher/all/ignore_spec.rb | 0 spec/{ => path_list}/matcher/all/two_spec.rb | 0 spec/{ => path_list}/matcher/all_spec.rb | 0 .../matcher/allow_any_dir_spec.rb | 0 spec/{ => path_list}/matcher/allow_spec.rb | 0 .../{ => path_list}/matcher/any/allow_spec.rb | 0 .../matcher/any/ignore_spec.rb | 0 spec/{ => path_list}/matcher/any/two_spec.rb | 0 spec/{ => path_list}/matcher/any_spec.rb | 0 spec/{ => path_list}/matcher/blank_spec.rb | 0 .../exact_string/case_insensitive_spec.rb | 0 .../exact_string/set/case_insensitive_spec.rb | 0 .../matcher/exact_string/set_spec.rb | 0 .../matcher/exact_string_spec.rb | 0 spec/{ => path_list}/matcher/ignore_spec.rb | 0 spec/{ => path_list}/matcher/invalid_spec.rb | 0 .../matcher/last_match/allow_spec.rb | 0 .../matcher/last_match/ignore_spec.rb | 0 .../matcher/last_match/two_spec.rb | 0 .../matcher/last_match_spec.rb | 0 .../matcher/match_if_dir_spec.rb | 0 .../matcher/match_unless_dir_spec.rb | 0 spec/{ => path_list}/matcher/mutable_spec.rb | 0 .../path_regexp/case_insensitive_spec.rb | 0 .../matcher/path_regexp_spec.rb | 0 .../matcher/path_regexp_wrapper_spec.rb | 0 .../matcher/shebang_regexp_spec.rb | 0 .../pattern_parser/exact_path_spec.rb | 0 .../pattern_parser/gitignore_spec.rb | 0 .../pattern_parser/glob_gitignore_spec.rb | 4 +- .../pattern_parser/shebang_spec.rb | 0 spec/{ => path_list}/pattern_parser_spec.rb | 0 .../{ => path_list}/token_regexp/path_spec.rb | 0 ...re_spec.rb => path_list_gitignore_spec.rb} | 0 ...rb => path_list_ignore_or_include_spec.rb} | 0 46 files changed, 34 insertions(+), 32 deletions(-) rename spec/{ => path_list}/candidate_spec.rb (100%) rename spec/{ => path_list}/canonical_path_spec.rb (100%) rename spec/{ => path_list}/gitconfig/core_excludesfile_spec.rb (100%) rename spec/{ => path_list}/gitconfig/file_parser_spec.rb (100%) rename spec/{ => path_list}/matcher/all/allow_spec.rb (100%) rename spec/{ => path_list}/matcher/all/ignore_spec.rb (100%) rename spec/{ => path_list}/matcher/all/two_spec.rb (100%) rename spec/{ => path_list}/matcher/all_spec.rb (100%) rename spec/{ => path_list}/matcher/allow_any_dir_spec.rb (100%) rename spec/{ => path_list}/matcher/allow_spec.rb (100%) rename spec/{ => path_list}/matcher/any/allow_spec.rb (100%) rename spec/{ => path_list}/matcher/any/ignore_spec.rb (100%) rename spec/{ => path_list}/matcher/any/two_spec.rb (100%) rename spec/{ => path_list}/matcher/any_spec.rb (100%) rename spec/{ => path_list}/matcher/blank_spec.rb (100%) rename spec/{ => path_list}/matcher/exact_string/case_insensitive_spec.rb (100%) rename spec/{ => path_list}/matcher/exact_string/set/case_insensitive_spec.rb (100%) rename spec/{ => path_list}/matcher/exact_string/set_spec.rb (100%) rename spec/{ => path_list}/matcher/exact_string_spec.rb (100%) rename spec/{ => path_list}/matcher/ignore_spec.rb (100%) rename spec/{ => path_list}/matcher/invalid_spec.rb (100%) rename spec/{ => path_list}/matcher/last_match/allow_spec.rb (100%) rename spec/{ => path_list}/matcher/last_match/ignore_spec.rb (100%) rename spec/{ => path_list}/matcher/last_match/two_spec.rb (100%) rename spec/{ => path_list}/matcher/last_match_spec.rb (100%) rename spec/{ => path_list}/matcher/match_if_dir_spec.rb (100%) rename spec/{ => path_list}/matcher/match_unless_dir_spec.rb (100%) rename spec/{ => path_list}/matcher/mutable_spec.rb (100%) rename spec/{ => path_list}/matcher/path_regexp/case_insensitive_spec.rb (100%) rename spec/{ => path_list}/matcher/path_regexp_spec.rb (100%) rename spec/{ => path_list}/matcher/path_regexp_wrapper_spec.rb (100%) rename spec/{ => path_list}/matcher/shebang_regexp_spec.rb (100%) rename spec/{ => path_list}/pattern_parser/exact_path_spec.rb (100%) rename spec/{ => path_list}/pattern_parser/gitignore_spec.rb (100%) rename spec/{ => path_list}/pattern_parser/glob_gitignore_spec.rb (99%) rename spec/{ => path_list}/pattern_parser/shebang_spec.rb (100%) rename spec/{ => path_list}/pattern_parser_spec.rb (100%) rename spec/{ => path_list}/token_regexp/path_spec.rb (100%) rename spec/{gitignore_spec.rb => path_list_gitignore_spec.rb} (100%) rename spec/{ignore_or_include_spec.rb => path_list_ignore_or_include_spec.rb} (100%) diff --git a/.rubocop.yml b/.rubocop.yml index e4fc715..d4df66c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -19,7 +19,7 @@ AllCops: - bin/benchmark # i have things rubocop doesn't like that i want to keep DisplayCopNames: true DisplayStyleGuide: true - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 # all of our layout customisations are because we prefer indentation to be # always consistently 2 spaces, for blocks, scopes, multiline expressions, etc diff --git a/Gemfile.lock b/Gemfile.lock index 3a6029c..a96120b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,7 +10,7 @@ GEM ast (2.4.2) benchmark-ips (2.12.0) coderay (1.1.3) - commonmarker (0.23.9) + commonmarker (0.23.10) debug (1.8.0) irb (>= 1.5.0) reline (>= 0.3.1) @@ -19,8 +19,9 @@ GEM fast_ignore (0.17.4) io-console (0.6.0) io-console (0.6.0-java) - irb (1.7.1) - reline (>= 0.3.0) + irb (1.9.1) + rdoc + reline (>= 0.3.8) jar-dependencies (0.4.1) jaro_winkler (1.5.6) jaro_winkler (1.5.6-java) @@ -33,26 +34,26 @@ GEM parser method_source (1.0.0) parallel (1.23.0) - parser (3.2.2.3) + parser (3.2.2.4) ast (~> 2.4.1) racc pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - psych (5.1.0) + psych (5.1.1.1) stringio - psych (5.1.0-java) + psych (5.1.1.1-java) jar-dependencies (>= 0.1.7) - racc (1.7.1) - racc (1.7.1-java) + racc (1.7.3) + racc (1.7.3-java) rainbow (3.1.1) - rake (13.0.6) - rdoc (6.5.0) + rake (13.1.0) + rdoc (6.6.0) psych (>= 4.0.0) - regexp_parser (2.8.1) - reline (0.3.5) + regexp_parser (2.8.2) + reline (0.4.0) io-console (~> 0.5) - rexml (3.2.5) + rexml (3.2.6) rspec (3.12.0) rspec-core (~> 3.12.0) rspec-expectations (~> 3.12.0) @@ -62,34 +63,34 @@ GEM rspec-expectations (3.12.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) - rspec-mocks (3.12.5) + rspec-mocks (3.12.6) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.12.0) rspec-support (3.12.1) - rubocop (1.54.0) + rubocop (1.57.2) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + 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.0, < 2.0) + rubocop-ast (>= 1.28.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) + rubocop-ast (1.30.0) parser (>= 3.2.1.0) - rubocop-capybara (2.18.0) + rubocop-capybara (2.19.0) rubocop (~> 1.41) - rubocop-factory_bot (2.23.1) + rubocop-factory_bot (2.24.0) rubocop (~> 1.33) - rubocop-performance (1.18.0) + rubocop-performance (1.19.1) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.22.0) - rubocop (~> 1.33) + rubocop-rspec (2.25.0) + rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) ruby-prof (0.18.0) @@ -109,11 +110,11 @@ GEM fast_ignore (>= 0.11.0) jaro_winkler parallel (~> 1.0) - stringio (3.0.7) + stringio (3.0.9) syntax_suggest (1.1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) webrick (1.8.1) yard (0.9.34) diff --git a/lib/path_list/matcher/exact_string.rb b/lib/path_list/matcher/exact_string.rb index 6d335b1..b822c92 100644 --- a/lib/path_list/matcher/exact_string.rb +++ b/lib/path_list/matcher/exact_string.rb @@ -41,7 +41,7 @@ def initialize(item, polarity) # @param (see Matcher#match) # @return (see Matcher#match) def match(candidate) - return @polarity if @item == candidate.full_path + @polarity if @item == candidate.full_path end # @return (see Matcher#inspect) diff --git a/lib/path_list/matcher/exact_string/case_insensitive.rb b/lib/path_list/matcher/exact_string/case_insensitive.rb index 15ec0a9..b17a259 100644 --- a/lib/path_list/matcher/exact_string/case_insensitive.rb +++ b/lib/path_list/matcher/exact_string/case_insensitive.rb @@ -22,7 +22,7 @@ def initialize(item, polarity) # @param (see Matcher#match) # @return (see Matcher#match) def match(candidate) - return @polarity if @item == candidate.full_path_downcase + @polarity if @item == candidate.full_path_downcase end end end diff --git a/lib/path_list/pattern_parser/glob_gitignore.rb b/lib/path_list/pattern_parser/glob_gitignore.rb index da3d8e5..ff677a3 100644 --- a/lib/path_list/pattern_parser/glob_gitignore.rb +++ b/lib/path_list/pattern_parser/glob_gitignore.rb @@ -103,7 +103,8 @@ def process_first_characters return dir_only! && emitted! if @s.dot_slash_end? return emitted! if @s.dot_slash_or_end? return process_up_a_level && dir_only! if @s.dot_dot_slash_end? - return process_up_a_level if @s.dot_dot_slash_or_end? + + process_up_a_level if @s.dot_dot_slash_or_end? end # @return [void] diff --git a/path_list.gemspec b/path_list.gemspec index 3958b3e..f4383e0 100644 --- a/path_list.gemspec +++ b/path_list.gemspec @@ -14,7 +14,7 @@ Gem::Specification.new do |spec| spec.homepage = 'https://github.com/robotdana/path_list' spec.license = 'MIT' - spec.required_ruby_version = '>= 2.7.0' + spec.required_ruby_version = '>= 3.0.0' if spec.respond_to?(:metadata) spec.metadata['homepage_uri'] = spec.homepage diff --git a/spec/candidate_spec.rb b/spec/path_list/candidate_spec.rb similarity index 100% rename from spec/candidate_spec.rb rename to spec/path_list/candidate_spec.rb diff --git a/spec/canonical_path_spec.rb b/spec/path_list/canonical_path_spec.rb similarity index 100% rename from spec/canonical_path_spec.rb rename to spec/path_list/canonical_path_spec.rb diff --git a/spec/gitconfig/core_excludesfile_spec.rb b/spec/path_list/gitconfig/core_excludesfile_spec.rb similarity index 100% rename from spec/gitconfig/core_excludesfile_spec.rb rename to spec/path_list/gitconfig/core_excludesfile_spec.rb diff --git a/spec/gitconfig/file_parser_spec.rb b/spec/path_list/gitconfig/file_parser_spec.rb similarity index 100% rename from spec/gitconfig/file_parser_spec.rb rename to spec/path_list/gitconfig/file_parser_spec.rb diff --git a/spec/matcher/all/allow_spec.rb b/spec/path_list/matcher/all/allow_spec.rb similarity index 100% rename from spec/matcher/all/allow_spec.rb rename to spec/path_list/matcher/all/allow_spec.rb diff --git a/spec/matcher/all/ignore_spec.rb b/spec/path_list/matcher/all/ignore_spec.rb similarity index 100% rename from spec/matcher/all/ignore_spec.rb rename to spec/path_list/matcher/all/ignore_spec.rb diff --git a/spec/matcher/all/two_spec.rb b/spec/path_list/matcher/all/two_spec.rb similarity index 100% rename from spec/matcher/all/two_spec.rb rename to spec/path_list/matcher/all/two_spec.rb diff --git a/spec/matcher/all_spec.rb b/spec/path_list/matcher/all_spec.rb similarity index 100% rename from spec/matcher/all_spec.rb rename to spec/path_list/matcher/all_spec.rb diff --git a/spec/matcher/allow_any_dir_spec.rb b/spec/path_list/matcher/allow_any_dir_spec.rb similarity index 100% rename from spec/matcher/allow_any_dir_spec.rb rename to spec/path_list/matcher/allow_any_dir_spec.rb diff --git a/spec/matcher/allow_spec.rb b/spec/path_list/matcher/allow_spec.rb similarity index 100% rename from spec/matcher/allow_spec.rb rename to spec/path_list/matcher/allow_spec.rb diff --git a/spec/matcher/any/allow_spec.rb b/spec/path_list/matcher/any/allow_spec.rb similarity index 100% rename from spec/matcher/any/allow_spec.rb rename to spec/path_list/matcher/any/allow_spec.rb diff --git a/spec/matcher/any/ignore_spec.rb b/spec/path_list/matcher/any/ignore_spec.rb similarity index 100% rename from spec/matcher/any/ignore_spec.rb rename to spec/path_list/matcher/any/ignore_spec.rb diff --git a/spec/matcher/any/two_spec.rb b/spec/path_list/matcher/any/two_spec.rb similarity index 100% rename from spec/matcher/any/two_spec.rb rename to spec/path_list/matcher/any/two_spec.rb diff --git a/spec/matcher/any_spec.rb b/spec/path_list/matcher/any_spec.rb similarity index 100% rename from spec/matcher/any_spec.rb rename to spec/path_list/matcher/any_spec.rb diff --git a/spec/matcher/blank_spec.rb b/spec/path_list/matcher/blank_spec.rb similarity index 100% rename from spec/matcher/blank_spec.rb rename to spec/path_list/matcher/blank_spec.rb diff --git a/spec/matcher/exact_string/case_insensitive_spec.rb b/spec/path_list/matcher/exact_string/case_insensitive_spec.rb similarity index 100% rename from spec/matcher/exact_string/case_insensitive_spec.rb rename to spec/path_list/matcher/exact_string/case_insensitive_spec.rb diff --git a/spec/matcher/exact_string/set/case_insensitive_spec.rb b/spec/path_list/matcher/exact_string/set/case_insensitive_spec.rb similarity index 100% rename from spec/matcher/exact_string/set/case_insensitive_spec.rb rename to spec/path_list/matcher/exact_string/set/case_insensitive_spec.rb diff --git a/spec/matcher/exact_string/set_spec.rb b/spec/path_list/matcher/exact_string/set_spec.rb similarity index 100% rename from spec/matcher/exact_string/set_spec.rb rename to spec/path_list/matcher/exact_string/set_spec.rb diff --git a/spec/matcher/exact_string_spec.rb b/spec/path_list/matcher/exact_string_spec.rb similarity index 100% rename from spec/matcher/exact_string_spec.rb rename to spec/path_list/matcher/exact_string_spec.rb diff --git a/spec/matcher/ignore_spec.rb b/spec/path_list/matcher/ignore_spec.rb similarity index 100% rename from spec/matcher/ignore_spec.rb rename to spec/path_list/matcher/ignore_spec.rb diff --git a/spec/matcher/invalid_spec.rb b/spec/path_list/matcher/invalid_spec.rb similarity index 100% rename from spec/matcher/invalid_spec.rb rename to spec/path_list/matcher/invalid_spec.rb diff --git a/spec/matcher/last_match/allow_spec.rb b/spec/path_list/matcher/last_match/allow_spec.rb similarity index 100% rename from spec/matcher/last_match/allow_spec.rb rename to spec/path_list/matcher/last_match/allow_spec.rb diff --git a/spec/matcher/last_match/ignore_spec.rb b/spec/path_list/matcher/last_match/ignore_spec.rb similarity index 100% rename from spec/matcher/last_match/ignore_spec.rb rename to spec/path_list/matcher/last_match/ignore_spec.rb diff --git a/spec/matcher/last_match/two_spec.rb b/spec/path_list/matcher/last_match/two_spec.rb similarity index 100% rename from spec/matcher/last_match/two_spec.rb rename to spec/path_list/matcher/last_match/two_spec.rb diff --git a/spec/matcher/last_match_spec.rb b/spec/path_list/matcher/last_match_spec.rb similarity index 100% rename from spec/matcher/last_match_spec.rb rename to spec/path_list/matcher/last_match_spec.rb diff --git a/spec/matcher/match_if_dir_spec.rb b/spec/path_list/matcher/match_if_dir_spec.rb similarity index 100% rename from spec/matcher/match_if_dir_spec.rb rename to spec/path_list/matcher/match_if_dir_spec.rb diff --git a/spec/matcher/match_unless_dir_spec.rb b/spec/path_list/matcher/match_unless_dir_spec.rb similarity index 100% rename from spec/matcher/match_unless_dir_spec.rb rename to spec/path_list/matcher/match_unless_dir_spec.rb diff --git a/spec/matcher/mutable_spec.rb b/spec/path_list/matcher/mutable_spec.rb similarity index 100% rename from spec/matcher/mutable_spec.rb rename to spec/path_list/matcher/mutable_spec.rb diff --git a/spec/matcher/path_regexp/case_insensitive_spec.rb b/spec/path_list/matcher/path_regexp/case_insensitive_spec.rb similarity index 100% rename from spec/matcher/path_regexp/case_insensitive_spec.rb rename to spec/path_list/matcher/path_regexp/case_insensitive_spec.rb diff --git a/spec/matcher/path_regexp_spec.rb b/spec/path_list/matcher/path_regexp_spec.rb similarity index 100% rename from spec/matcher/path_regexp_spec.rb rename to spec/path_list/matcher/path_regexp_spec.rb diff --git a/spec/matcher/path_regexp_wrapper_spec.rb b/spec/path_list/matcher/path_regexp_wrapper_spec.rb similarity index 100% rename from spec/matcher/path_regexp_wrapper_spec.rb rename to spec/path_list/matcher/path_regexp_wrapper_spec.rb diff --git a/spec/matcher/shebang_regexp_spec.rb b/spec/path_list/matcher/shebang_regexp_spec.rb similarity index 100% rename from spec/matcher/shebang_regexp_spec.rb rename to spec/path_list/matcher/shebang_regexp_spec.rb diff --git a/spec/pattern_parser/exact_path_spec.rb b/spec/path_list/pattern_parser/exact_path_spec.rb similarity index 100% rename from spec/pattern_parser/exact_path_spec.rb rename to spec/path_list/pattern_parser/exact_path_spec.rb diff --git a/spec/pattern_parser/gitignore_spec.rb b/spec/path_list/pattern_parser/gitignore_spec.rb similarity index 100% rename from spec/pattern_parser/gitignore_spec.rb rename to spec/path_list/pattern_parser/gitignore_spec.rb diff --git a/spec/pattern_parser/glob_gitignore_spec.rb b/spec/path_list/pattern_parser/glob_gitignore_spec.rb similarity index 99% rename from spec/pattern_parser/glob_gitignore_spec.rb rename to spec/path_list/pattern_parser/glob_gitignore_spec.rb index b462a94..4336dde 100644 --- a/spec/pattern_parser/glob_gitignore_spec.rb +++ b/spec/path_list/pattern_parser/glob_gitignore_spec.rb @@ -333,7 +333,7 @@ def build(pattern) stub_const('::File::ALT_SEPARATOR', '\\') silence_warnings do - load File.expand_path('../../lib/path_list/pattern_parser/glob_gitignore/scanner.rb', __dir__) + load File.expand_path('../../../lib/path_list/pattern_parser/glob_gitignore/scanner.rb', __dir__) end end @@ -345,7 +345,7 @@ def build(pattern) stub_const('::File::ALT_SEPARATOR', windows? ? '\\' : nil) silence_warnings do - load File.expand_path('../../lib/path_list/pattern_parser/glob_gitignore/scanner.rb', __dir__) + load File.expand_path('../../../lib/path_list/pattern_parser/glob_gitignore/scanner.rb', __dir__) end end diff --git a/spec/pattern_parser/shebang_spec.rb b/spec/path_list/pattern_parser/shebang_spec.rb similarity index 100% rename from spec/pattern_parser/shebang_spec.rb rename to spec/path_list/pattern_parser/shebang_spec.rb diff --git a/spec/pattern_parser_spec.rb b/spec/path_list/pattern_parser_spec.rb similarity index 100% rename from spec/pattern_parser_spec.rb rename to spec/path_list/pattern_parser_spec.rb diff --git a/spec/token_regexp/path_spec.rb b/spec/path_list/token_regexp/path_spec.rb similarity index 100% rename from spec/token_regexp/path_spec.rb rename to spec/path_list/token_regexp/path_spec.rb diff --git a/spec/gitignore_spec.rb b/spec/path_list_gitignore_spec.rb similarity index 100% rename from spec/gitignore_spec.rb rename to spec/path_list_gitignore_spec.rb diff --git a/spec/ignore_or_include_spec.rb b/spec/path_list_ignore_or_include_spec.rb similarity index 100% rename from spec/ignore_or_include_spec.rb rename to spec/path_list_ignore_or_include_spec.rb