diff options
author | Hiroshi SHIBATA <[email protected]> | 2022-12-12 09:09:23 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2022-12-12 10:49:43 +0900 |
commit | bbe56a643734025aef6a3cbeb07c5306505040f6 (patch) | |
tree | c6980a39ce6571c032695702bd974431eee4d516 /spec/bundler/quality_spec.rb | |
parent | f1cdc129d4d6440168b840fa852fa6c3e28d46a9 (diff) |
Merge RubyGems/Bundler master
from https://github.com/rubygems/rubygems/commit/bfb0ae69776069155d2092702bfbb5a12617d85a
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6906
Diffstat (limited to 'spec/bundler/quality_spec.rb')
-rw-r--r-- | spec/bundler/quality_spec.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/bundler/quality_spec.rb b/spec/bundler/quality_spec.rb index 86a927c361..86e5a51f7f 100644 --- a/spec/bundler/quality_spec.rb +++ b/spec/bundler/quality_spec.rb @@ -12,7 +12,7 @@ RSpec.describe "The library itself" do failing_lines = [] each_line(filename) do |line, number| - failing_lines << number + 1 if line =~ merge_conflicts_regex + failing_lines << number + 1 if line&.match?(merge_conflicts_regex) end return if failing_lines.empty? @@ -32,8 +32,8 @@ RSpec.describe "The library itself" do def check_for_extra_spaces(filename) failing_lines = [] each_line(filename) do |line, number| - next if line =~ /^\s+#.*\s+\n$/ - failing_lines << number + 1 if line =~ /\s+\n$/ + next if /^\s+#.*\s+\n$/.match?(line) + failing_lines << number + 1 if /\s+\n$/.match?(line) end return if failing_lines.empty? @@ -45,7 +45,7 @@ RSpec.describe "The library itself" do failing_lines = [] each_line(filename) do |line, number| - failing_lines << number + 1 if line =~ /’/ + failing_lines << number + 1 if /’/.match?(line) end return if failing_lines.empty? @@ -89,7 +89,7 @@ RSpec.describe "The library itself" do exempt = /\.gitmodules|fixtures|vendor|LICENSE|vcr_cassettes|rbreadline\.diff|index\.txt$/ error_messages = [] tracked_files.each do |filename| - next if filename =~ exempt + next if filename&.match?(exempt) error_messages << check_for_tab_characters(filename) error_messages << check_for_extra_spaces(filename) end @@ -100,7 +100,7 @@ RSpec.describe "The library itself" do exempt = /vendor|vcr_cassettes|LICENSE|rbreadline\.diff/ error_messages = [] tracked_files.each do |filename| - next if filename =~ exempt + next if filename&.match?(exempt) error_messages << check_for_straneous_quotes(filename) end expect(error_messages.compact).to be_well_formed @@ -110,7 +110,7 @@ RSpec.describe "The library itself" do error_messages = [] exempt = %r{lock/lockfile_spec|quality_spec|vcr_cassettes|\.ronn|lockfile_parser\.rb} tracked_files.each do |filename| - next if filename =~ exempt + next if filename&.match?(exempt) error_messages << check_for_git_merge_conflicts(filename) end expect(error_messages.compact).to be_well_formed @@ -120,7 +120,7 @@ RSpec.describe "The library itself" do included = /ronn/ error_messages = [] man_tracked_files.each do |filename| - next unless filename =~ included + next unless filename&.match?(included) error_messages << check_for_expendable_words(filename) error_messages << check_for_specific_pronouns(filename) end @@ -131,7 +131,7 @@ RSpec.describe "The library itself" do error_messages = [] exempt = /vendor|vcr_cassettes|CODE_OF_CONDUCT/ lib_tracked_files.each do |filename| - next if filename =~ exempt + next if filename&.match?(exempt) error_messages << check_for_expendable_words(filename) error_messages << check_for_specific_pronouns(filename) end @@ -229,7 +229,7 @@ RSpec.describe "The library itself" do exempt = %r{templates/|\.5|\.1|vendor/} all_bad_requires = [] lib_tracked_files.each do |filename| - next if filename =~ exempt + next if filename&.match?(exempt) each_line(filename) do |line, number| line.scan(/^ *require "bundler/).each { all_bad_requires << "#{filename}:#{number.succ}" } end |