From 396a82c4d56bc0067c86de7cd32a4ae75f292c41 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Thu, 23 Dec 2021 11:03:11 -0500 Subject: [PATCH] standardrb --only Layout/LeadingCommentSpace --fix --- Rakefile | 6 +++--- lib/diff/lcs.rb | 10 +++++----- lib/diff/lcs/callbacks.rb | 2 +- lib/diff/lcs/htmldiff.rb | 4 ++-- lib/diff/lcs/hunk.rb | 6 +++--- lib/diff/lcs/ldiff.rb | 10 +++++----- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Rakefile b/Rakefile index f5c4f80..9aa8d42 100644 --- a/Rakefile +++ b/Rakefile @@ -46,19 +46,19 @@ Hoe.plugin :gemspec2 Hoe.plugin :git if RUBY_VERSION < "1.9" - class Array #:nodoc: + class Array # :nodoc: def to_h Hash[*flatten(1)] end end - class Gem::Specification #:nodoc: + class Gem::Specification # :nodoc: def metadata=(*); end def default_value(*); end end - class Object #:nodoc: + class Object # :nodoc: def caller_locations(*) [] end diff --git a/lib/diff/lcs.rb b/lib/diff/lcs.rb index db2b03d..031e2d7 100644 --- a/lib/diff/lcs.rb +++ b/lib/diff/lcs.rb @@ -67,7 +67,7 @@ module Diff::LCS # rubocop:disable Style/Documentation # identically for key purposes. That is: # # O.new('a').eql?(O.new('a')) == true - def lcs(other, &block) #:yields: self[i] if there are matched subsequences + def lcs(other, &block) # :yields: self[i] if there are matched subsequences Diff::LCS.lcs(self, other, &block) end @@ -141,7 +141,7 @@ def unpatch_me(patchset) end class << Diff::LCS - def lcs(seq1, seq2, &block) #:yields: seq1[i] for each matched + def lcs(seq1, seq2, &block) # :yields: seq1[i] for each matched matches = Diff::LCS::Internals.lcs(seq1, seq2) ret = [] string = seq1.kind_of? String @@ -197,7 +197,7 @@ def diff(seq1, seq2, callbacks = nil, &block) # :yields: diff changes # # insert # end # end - def sdiff(seq1, seq2, callbacks = nil, &block) #:yields: diff changes + def sdiff(seq1, seq2, callbacks = nil, &block) # :yields: diff changes diff_traversal(:sdiff, seq1, seq2, callbacks || Diff::LCS::SDiffCallbacks, &block) end @@ -282,7 +282,7 @@ def sdiff(seq1, seq2, callbacks = nil, &block) #:yields: diff changes # callbacks#discard_b will be called after the end of the sequence # is reached, if +a+ has not yet reached the end of +A+ or +b+ has not yet # reached the end of +B+. - def traverse_sequences(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks) #:yields: change events + def traverse_sequences(seq1, seq2, callbacks = Diff::LCS::SequenceCallbacks) # :yields: change events callbacks ||= Diff::LCS::SequenceCallbacks matches = Diff::LCS::Internals.lcs(seq1, seq2) @@ -576,7 +576,7 @@ def traverse_balanced(seq1, seq2, callbacks = Diff::LCS::BalancedCallbacks) end end - PATCH_MAP = { #:nodoc: + PATCH_MAP = { # :nodoc: :patch => { "+" => "+", "-" => "-", "!" => "!", "=" => "=" }.freeze, :unpatch => { "+" => "-", "-" => "+", "!" => "!", "=" => "=" }.freeze }.freeze diff --git a/lib/diff/lcs/callbacks.rb b/lib/diff/lcs/callbacks.rb index 54b3686..cdda2dd 100644 --- a/lib/diff/lcs/callbacks.rb +++ b/lib/diff/lcs/callbacks.rb @@ -302,7 +302,7 @@ class Diff::LCS::SDiffCallbacks # Returns the difference set collected during the diff process. attr_reader :diffs - def initialize #:yields: self + def initialize # :yields: self @diffs = [] yield self if block_given? end diff --git a/lib/diff/lcs/htmldiff.rb b/lib/diff/lcs/htmldiff.rb index 37bbc4a..7eab41d 100644 --- a/lib/diff/lcs/htmldiff.rb +++ b/lib/diff/lcs/htmldiff.rb @@ -5,11 +5,11 @@ # Produce a simple HTML diff view. class Diff::LCS::HTMLDiff class << self - attr_accessor :can_expand_tabs #:nodoc: + attr_accessor :can_expand_tabs # :nodoc: end self.can_expand_tabs = true - class Callbacks #:nodoc: + class Callbacks # :nodoc: attr_accessor :output attr_accessor :match_class attr_accessor :only_a_class diff --git a/lib/diff/lcs/hunk.rb b/lib/diff/lcs/hunk.rb index eccfc7a..d886ba2 100644 --- a/lib/diff/lcs/hunk.rb +++ b/lib/diff/lcs/hunk.rb @@ -6,8 +6,8 @@ # each block. (So if we're not using context, every hunk will contain one # block.) Used in the diff program (bin/ldiff). class Diff::LCS::Hunk - OLD_DIFF_OP_ACTION = { "+" => "a", "-" => "d", "!" => "c" }.freeze #:nodoc: - ED_DIFF_OP_ACTION = { "+" => "a", "-" => "d", "!" => "c" }.freeze #:nodoc: + OLD_DIFF_OP_ACTION = { "+" => "a", "-" => "d", "!" => "c" }.freeze # :nodoc: + ED_DIFF_OP_ACTION = { "+" => "a", "-" => "d", "!" => "c" }.freeze # :nodoc: private_constant :OLD_DIFF_OP_ACTION, :ED_DIFF_OP_ACTION if respond_to?(:private_constant) @@ -69,7 +69,7 @@ def initialize(data_old, data_new, piece, flag_context, file_length_difference) # to this hunk. attr_accessor :flag_context # rubocop:disable Layout/EmptyLinesAroundAttributeAccessor undef :flag_context= - def flag_context=(context) #:nodoc: # rubocop:disable Lint/DuplicateMethods + def flag_context=(context) # :nodoc: # rubocop:disable Lint/DuplicateMethods return if context.nil? || context.zero? add_start = context > @start_old ? @start_old : context diff --git a/lib/diff/lcs/ldiff.rb b/lib/diff/lcs/ldiff.rb index 1896203..961458c 100644 --- a/lib/diff/lcs/ldiff.rb +++ b/lib/diff/lcs/ldiff.rb @@ -4,7 +4,7 @@ require "ostruct" require "diff/lcs/hunk" -module Diff::LCS::Ldiff #:nodoc: +module Diff::LCS::Ldiff # :nodoc: # standard:disable Layout/HeredocIndentation BANNER = <<-COPYRIGHT ldiff #{Diff::LCS::VERSION} @@ -21,11 +21,11 @@ module Diff::LCS::Ldiff #:nodoc: end class << Diff::LCS::Ldiff - attr_reader :format, :lines #:nodoc: - attr_reader :file_old, :file_new #:nodoc: - attr_reader :data_old, :data_new #:nodoc: + attr_reader :format, :lines # :nodoc: + attr_reader :file_old, :file_new # :nodoc: + attr_reader :data_old, :data_new # :nodoc: - def run(args, _input = $stdin, output = $stdout, error = $stderr) #:nodoc: + def run(args, _input = $stdin, output = $stdout, error = $stderr) # :nodoc: @binary = nil args.options do |o|