From b60dbf13960370ef0e9db19ff92672c30ba06615 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:25:24 -0500 Subject: Clean up lint directives --- lib/diff/lcs.rb | 4 ++-- lib/diff/lcs/backports.rb | 4 ++-- lib/diff/lcs/callbacks.rb | 2 +- lib/diff/lcs/hunk.rb | 4 ++-- spec/spec_helper.rb | 8 ++------ 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index 77b508f..30385f8 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -module Diff; end unless defined? Diff # rubocop:disable Style/Documentation +module Diff; end unless defined? Diff # == How Diff Works (by Mark-Jason Dominus) # @@ -55,7 +55,7 @@ end require "diff/lcs/callbacks" require "diff/lcs/internals" -module Diff::LCS # rubocop:disable Style/Documentation +module Diff::LCS # Returns an Array containing the longest common subsequence(s) between # +self+ and +other+. See Diff::LCS#lcs. # diff --git a/lib/diff/lcs/backports.rb b/lib/diff/lcs/backports.rb index 642fc9c..3d2a768 100644 --- a/lib/diff/lcs/backports.rb +++ b/lib/diff/lcs/backports.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true unless 0.respond_to?(:positive?) - class Fixnum # rubocop:disable Lint/UnifiedInteger, Style/Documentation + class Fixnum # standard:disable Lint/UnifiedInteger def positive? - self > 0 # rubocop:disable Style/NumericPredicate + self > 0 end end end diff --git a/lib/diff/lcs/callbacks.rb b/lib/diff/lcs/callbacks.rb index cdda2dd..6fc229b 100644 --- a/lib/diff/lcs/callbacks.rb +++ b/lib/diff/lcs/callbacks.rb @@ -2,7 +2,7 @@ require "diff/lcs/change" -module Diff::LCS # rubocop:disable Style/Documentation +module Diff::LCS # This callback object implements the default set of callback events, # which only returns the event itself. Note that #finished_a and # #finished_b are not implemented -- I haven't yet figured out where they diff --git a/lib/diff/lcs/hunk.rb b/lib/diff/lcs/hunk.rb index 9ff3638..9f596f3 100644 --- a/lib/diff/lcs/hunk.rb +++ b/lib/diff/lcs/hunk.rb @@ -67,9 +67,9 @@ class Diff::LCS::Hunk # Change the "start" and "end" fields to note that context should be added # to this hunk. - attr_accessor :flag_context # rubocop:disable Layout/EmptyLinesAroundAttributeAccessor + attr_accessor :flag_context undef :flag_context= - def flag_context=(context) # :nodoc: # rubocop:disable Lint/DuplicateMethods + def flag_context=(context) # :nodoc: # standard:disable Lint/DuplicateMethods return if context.nil? || context.zero? add_start = context > @start_old ? @start_old : context diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9e3fea0..6993912 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -106,8 +106,8 @@ module Diff::LCS::SpecHelper %w[b c e j l m] end + # standard:disable Layout/ExtraSpacing def correct_forward_diff - # standard:disable Layout/ExtraSpacing [ [ ["-", 0, "a"] @@ -130,11 +130,9 @@ module Diff::LCS::SpecHelper ["+", 11, "t"] ] ] - # standard:enable Layout/ExtraSpacing end def correct_backward_diff - # standard:disable Layout/ExtraSpacing [ [ ["+", 0, "a"] @@ -157,11 +155,9 @@ module Diff::LCS::SpecHelper ["-", 11, "t"] ] ] - # standard:enable Layout/ExtraSpacing end def correct_forward_sdiff - # standard:disable Layout/ExtraSpacing [ ["-", [0, "a"], [0, nil]], ["=", [1, "b"], [0, "b"]], @@ -177,8 +173,8 @@ module Diff::LCS::SpecHelper ["!", [9, "p"], [10, "s"]], ["+", [10, nil], [11, "t"]] ] - # standard:enable Layout/ExtraSpacing end + # standard:enable Layout/ExtraSpacing def reverse_sdiff(forward_sdiff) forward_sdiff.map { |line| -- cgit v1.2.1