[前][次][番号順一覧][スレッド一覧]

ruby-changes:69507

From: Frederik <ko1@a...>
Date: Fri, 29 Oct 2021 18:19:08 +0900 (JST)
Subject: [ruby-changes:69507] 2a90ad7aa5 (master): [rubygems/rubygems] use Rubocop Lint/Debugger check rather than custom spec

https://git.ruby-lang.org/ruby.git/commit/?id=2a90ad7aa5

From 2a90ad7aa5dd434b200f66e20a98eba645b5838b Mon Sep 17 00:00:00 2001
From: Frederik Dudzik <frederik.dudzik@s...>
Date: Fri, 22 Oct 2021 10:28:30 -0700
Subject: [rubygems/rubygems] use Rubocop Lint/Debugger check rather than
 custom spec

We have a quality spec that check for debugger statements. Rubocop has a
cop that tests for the same thing. As such it makes sense to remove the
spec and activate the cop.

https://github.com/rubygems/rubygems/commit/dc1eb6eec5
---
 spec/bundler/quality_spec.rb | 29 -----------------------------
 1 file changed, 29 deletions(-)

diff --git a/spec/bundler/quality_spec.rb b/spec/bundler/quality_spec.rb
index 08ec8bed5c3..62f3722a392 100644
--- a/spec/bundler/quality_spec.rb
+++ b/spec/bundler/quality_spec.rb
@@ -3,25 +3,6 @@ https://github.com/ruby/ruby/blob/trunk/spec/bundler/quality_spec.rb#L3
 require "set"
 
 RSpec.describe "The library itself" do
-  def check_for_debugging_mechanisms(filename)
-    debugging_mechanisms_regex = /
-      (binding\.pry)|
-      (debugger)|
-      (sleep\s*\(?\d+)|
-      (fit\s*\(?("|\w))
-    /x
-
-    failing_lines = []
-    each_line(filename) do |line, number|
-      if line =~ debugging_mechanisms_regex && !line.end_with?("# ignore quality_spec\n")
-        failing_lines << number + 1
-      end
-    end
-
-    return if failing_lines.empty?
-    "#{filename} has debugging mechanisms (like binding.pry, sleep, debugger, rspec focusing, etc.) on lines #{failing_lines.join(", ")}"
-  end
-
   def check_for_git_merge_conflicts(filename)
     merge_conflicts_regex = /
       <<<<<<<|
@@ -125,16 +106,6 @@ RSpec.describe "The library itself" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/quality_spec.rb#L106
     expect(error_messages.compact).to be_well_formed
   end
 
-  it "does not include any leftover debugging or development mechanisms" do
-    exempt = %r{quality_spec.rb|support/helpers|vcr_cassettes|\.md|\.ronn|index\.txt|\.5|\.1}
-    error_messages = []
-    tracked_files.each do |filename|
-      next if filename =~ exempt
-      error_messages << check_for_debugging_mechanisms(filename)
-    end
-    expect(error_messages.compact).to be_well_formed
-  end
-
   it "does not include any unresolved merge conflicts" do
     error_messages = []
     exempt = %r{lock/lockfile_spec|quality_spec|vcr_cassettes|\.ronn|lockfile_parser\.rb}
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]