Skip to content

Commit

Permalink
Lint/UselessMethodDefinition
Browse files Browse the repository at this point in the history
Remove method overrides that just call super.
  • Loading branch information
joshcooper committed Dec 2, 2023
1 parent 3696c77 commit a8e4b87
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 52 deletions.
11 changes: 0 additions & 11 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -636,17 +636,6 @@ Lint/SuppressedException:
Lint/UnusedMethodArgument:
Enabled: false

# This cop supports unsafe auto-correction (--auto-correct-all).
Lint/UselessMethodDefinition:
Exclude:
- 'lib/puppet/pops/evaluator/closure.rb'
- 'lib/puppet/pops/types/type_conversion_error.rb'
- 'lib/puppet/pops/types/type_mismatch_describer.rb'
- 'lib/puppet/settings/file_or_directory_setting.rb'
- 'lib/puppet/util/profiler/aggregate.rb'
- 'lib/puppet/util/rdoc/code_objects.rb'
- 'lib/puppet/util/rdoc/generators/puppet_generator.rb'

Naming/AccessorMethodName:
Enabled: false

Expand Down
12 changes: 2 additions & 10 deletions lib/puppet/pops/evaluator/closure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,9 @@ def initialize(value, file, line)
end
end

class Next < Jumper
def initialize(value, file, line)
super
end
end
class Next < Jumper; end

class Return < Jumper
def initialize(value, file, line)
super
end
end
class Return < Jumper; end

class PuppetStopIteration < StopIteration
attr_reader :file
Expand Down
11 changes: 1 addition & 10 deletions lib/puppet/pops/types/type_conversion_error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,5 @@
module Puppet::Pops::Types
# Raised when a conversion of a value to another type failed.
#
class TypeConversionError < Puppet::Error

# Creates a new instance with a given message
#
# @param message [String] The error message describing what failed
#
def initialize(message)
super(message)
end
end
class TypeConversionError < Puppet::Error; end
end
4 changes: 0 additions & 4 deletions lib/puppet/pops/types/type_mismatch_describer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -482,10 +482,6 @@ def range_to_s(range, zero_string)

# @api private
class CountMismatch < SizeMismatch
def initialize(path, expected, actual)
super(path, expected, actual)
end

def message(variant, position)
min = expected.from || 0
max = expected.to || Float::INFINITY
Expand Down
5 changes: 0 additions & 5 deletions lib/puppet/settings/file_or_directory_setting.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# frozen_string_literal: true
class Puppet::Settings::FileOrDirectorySetting < Puppet::Settings::FileSetting

def initialize(args)
super
end

def type
if Puppet::FileSystem.directory?(self.value) || @path_ends_with_slash
:directory
Expand Down
4 changes: 0 additions & 4 deletions lib/puppet/util/profiler/aggregate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ def shutdown()
@logger.call("----------------------------")
end

def do_start(description, metric_id)
super(description, metric_id)
end

def do_finish(context, description, metric_id)
result = super(context, description, metric_id)
update_metric(@metrics_hash, metric_id, result[:time])
Expand Down
4 changes: 0 additions & 4 deletions lib/puppet/util/rdoc/code_objects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ def find_symbol(symbol, method=nil)
class PuppetNode < PuppetClass
include AddClassModuleComment

def initialize(name, superclass)
super(name,superclass)
end

def is_module?
false
end
Expand Down
4 changes: 0 additions & 4 deletions lib/puppet/util/rdoc/generators/puppet_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,6 @@ def <=>(other)

class HTMLPuppetModule < HtmlClass

def initialize(context, html_file, prefix, options)
super(context, html_file, prefix, options)
end

def value_hash
@values = super

Expand Down

0 comments on commit a8e4b87

Please sign in to comment.