Skip to content

Commit db04912

Browse files
committed
Lint/UselessMethodDefinition
Remove method overrides that just call super.
1 parent 7484220 commit db04912

File tree

8 files changed

+3
-52
lines changed

8 files changed

+3
-52
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -643,17 +643,6 @@ Lint/ToJSON:
643643
Lint/UnusedMethodArgument:
644644
Enabled: false
645645

646-
# This cop supports unsafe auto-correction (--auto-correct-all).
647-
Lint/UselessMethodDefinition:
648-
Exclude:
649-
- 'lib/puppet/pops/evaluator/closure.rb'
650-
- 'lib/puppet/pops/types/type_conversion_error.rb'
651-
- 'lib/puppet/pops/types/type_mismatch_describer.rb'
652-
- 'lib/puppet/settings/file_or_directory_setting.rb'
653-
- 'lib/puppet/util/profiler/aggregate.rb'
654-
- 'lib/puppet/util/rdoc/code_objects.rb'
655-
- 'lib/puppet/util/rdoc/generators/puppet_generator.rb'
656-
657646
Naming/AccessorMethodName:
658647
Enabled: false
659648

lib/puppet/pops/evaluator/closure.rb

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,9 @@ def initialize(value, file, line)
1212
end
1313
end
1414

15-
class Next < Jumper
16-
def initialize(value, file, line)
17-
super
18-
end
19-
end
15+
class Next < Jumper; end
2016

21-
class Return < Jumper
22-
def initialize(value, file, line)
23-
super
24-
end
25-
end
17+
class Return < Jumper; end
2618

2719
class PuppetStopIteration < StopIteration
2820
attr_reader :file

lib/puppet/pops/types/type_conversion_error.rb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,5 @@
33
module Puppet::Pops::Types
44
# Raised when a conversion of a value to another type failed.
55
#
6-
class TypeConversionError < Puppet::Error
7-
8-
# Creates a new instance with a given message
9-
#
10-
# @param message [String] The error message describing what failed
11-
#
12-
def initialize(message)
13-
super(message)
14-
end
15-
end
6+
class TypeConversionError < Puppet::Error; end
167
end

lib/puppet/pops/types/type_mismatch_describer.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,6 @@ def range_to_s(range, zero_string)
482482

483483
# @api private
484484
class CountMismatch < SizeMismatch
485-
def initialize(path, expected, actual)
486-
super(path, expected, actual)
487-
end
488-
489485
def message(variant, position)
490486
min = expected.from || 0
491487
max = expected.to || Float::INFINITY

lib/puppet/settings/file_or_directory_setting.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
# frozen_string_literal: true
22
class Puppet::Settings::FileOrDirectorySetting < Puppet::Settings::FileSetting
3-
4-
def initialize(args)
5-
super
6-
end
7-
83
def type
94
if Puppet::FileSystem.directory?(self.value) || @path_ends_with_slash
105
:directory

lib/puppet/util/profiler/aggregate.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ def shutdown()
1616
@logger.call("----------------------------")
1717
end
1818

19-
def do_start(description, metric_id)
20-
super(description, metric_id)
21-
end
22-
2319
def do_finish(context, description, metric_id)
2420
result = super(context, description, metric_id)
2521
update_metric(@metrics_hash, metric_id, result[:time])

lib/puppet/util/rdoc/code_objects.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,6 @@ def find_symbol(symbol, method=nil)
185185
class PuppetNode < PuppetClass
186186
include AddClassModuleComment
187187

188-
def initialize(name, superclass)
189-
super(name,superclass)
190-
end
191-
192188
def is_module?
193189
false
194190
end

lib/puppet/util/rdoc/generators/puppet_generator.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,10 +650,6 @@ def <=>(other)
650650

651651
class HTMLPuppetModule < HtmlClass
652652

653-
def initialize(context, html_file, prefix, options)
654-
super(context, html_file, prefix, options)
655-
end
656-
657653
def value_hash
658654
@values = super
659655

0 commit comments

Comments
 (0)