Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 9 additions & 51 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config --no-offense-counts --no-auto-gen-timestamp`
# using RuboCop version 1.86.1.
# using RuboCop version 1.88.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -22,26 +22,6 @@ I18n/GetText/DecorateStringFormattingUsingPercent:
I18n/RailsI18n/DecorateString:
Enabled: false

# This cop supports safe autocorrection (--autocorrect).
Layout/EmptyLinesAroundMethodBody:
Exclude:
- 'lib/puppet/transaction/event.rb'
- 'lib/puppet/util/windows/file.rb'

# This cop supports safe autocorrection (--autocorrect).
Layout/SpaceAroundKeyword:
Exclude:
- 'lib/puppet/provider/package/portage.rb'
- 'lib/puppet/type/file.rb'

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals.
# SupportedStylesForExponentOperator: space, no_space
# SupportedStylesForRationalLiterals: space, no_space
Layout/SpaceAroundOperators:
Exclude:
- 'lib/puppet/util/symbolic_file_mode.rb'

# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Expand Down Expand Up @@ -259,7 +239,6 @@ Style/CaseEquality:
- 'lib/puppet/module_tool/shared_behaviors.rb'
- 'lib/puppet/util/log/destination.rb'
- 'lib/puppet/util/multi_match.rb'
- 'lib/puppet/util/rdoc/generators/puppet_generator.rb'

# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle, EnforcedStyleForClasses, EnforcedStyleForModules.
Expand Down Expand Up @@ -292,8 +271,6 @@ Style/CommentAnnotation:
Style/CommentedKeyword:
Exclude:
- 'lib/puppet/util/command_line/trollop.rb'
- 'lib/puppet/util/rdoc/generators/puppet_generator.rb'
- 'lib/puppet/util/rdoc/generators/template/puppet/puppet.rb'
- 'lib/puppet/util/rpm_compare.rb'
- 'lib/puppet/util/windows/service.rb'

Expand Down Expand Up @@ -325,24 +302,14 @@ Style/DoubleNegation:
# Configuration parameters: EnforcedStyle, AllowComments.
# SupportedStyles: empty, nil, both
Style/EmptyElse:
Enabled: false

# This cop supports safe autocorrection (--autocorrect).
Style/EmptyLiteral:
Exclude:
- 'lib/puppet/parser/scope.rb'
- 'lib/puppet/pops/puppet_stack.rb'
- 'lib/puppet/pops/visitor.rb'
- 'lib/puppet/provider/package/portupgrade.rb'
- 'lib/puppet/provider/service/launchd.rb'
- 'lib/puppet/provider/user/directoryservice.rb'
- 'lib/puppet/type.rb'

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: compact, expanded
Style/EmptyMethod:
Enabled: false
- 'lib/puppet/pal/plan_signature.rb'
- 'lib/puppet/pops/loader/dependency_loader.rb'
- 'lib/puppet/pops/types/iterable.rb'
- 'lib/puppet/pops/types/p_sem_ver_range_type.rb'
- 'lib/puppet/pops/types/type_calculator.rb'
- 'lib/puppet/pops/types/types.rb'
- 'lib/puppet/ssl/state_machine.rb'

# This cop supports safe autocorrection (--autocorrect).
Style/Encoding:
Expand Down Expand Up @@ -456,13 +423,6 @@ Style/MissingRespondToMissing:
- 'lib/puppet/util/command_line/trollop.rb'
- 'lib/puppet/util/feature.rb'

# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: separated, grouped
Style/MixinGrouping:
Exclude:
- 'lib/puppet/util/rdoc/generators/puppet_generator.rb'

Style/MultilineBlockChain:
Enabled: false

Expand All @@ -478,7 +438,6 @@ Style/MultilineIfModifier:
- 'lib/puppet/provider/package/windows.rb'
- 'lib/puppet/provider/service/upstart.rb'
- 'lib/puppet/resource/catalog.rb'
- 'lib/puppet/type/file/content.rb'
- 'lib/puppet/type/user.rb'
- 'lib/puppet/util/execution.rb'
- 'lib/puppet/util/windows/com.rb'
Expand Down Expand Up @@ -525,7 +484,7 @@ Style/MultipleComparison:
Enabled: false

# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.
# Configuration parameters: EnforcedStyle, Recursive.
# SupportedStyles: literals, strict
Style/MutableConstant:
Enabled: false
Expand Down Expand Up @@ -638,7 +597,6 @@ Style/StderrPuts:
- 'lib/puppet/reference/type.rb'
- 'lib/puppet/util.rb'
- 'lib/puppet/util/command_line/trollop.rb'
- 'lib/puppet/util/rdoc/generators/puppet_generator.rb'

# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: Mode.
Expand Down
3 changes: 1 addition & 2 deletions ext/windows/service/daemon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ class WindowsDaemon < Puppet::Util::Windows::Daemon
end
end

def service_init
end
def service_init; end

def service_main(*argsv)
argsv = (argsv << ARGV).flatten.compact
Expand Down
2 changes: 0 additions & 2 deletions lib/hiera/scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ def find_hostclass(scope)
scope.source.name.downcase
elsif scope.parent
find_hostclass(scope.parent)
else
nil
end
end
private :find_hostclass
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@ def initialize_app_defaults
# usually not necessary to override this method.
# @return [void]
# @api public
def preinit
end
def preinit; end

# Call in setup of subclass to deprecate an application.
# @return [void]
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/confine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,5 @@ def valid?
end

# Provide a hook for subclasses.
def reset
end
def reset; end
end
15 changes: 3 additions & 12 deletions lib/puppet/environments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ def get_conf(name)
env = get(name)
if env
Puppet::Settings::EnvironmentConf.static_for(env, Puppet[:environment_timeout], Puppet[:static_catalogs], Puppet[:rich_data])
else
nil
end
end
end
Expand Down Expand Up @@ -221,8 +219,6 @@ def get_conf(name)
envdir = validated_directory(File.join(@environment_dir, name.to_s))
if envdir
Puppet::Settings::EnvironmentConf.load_from(envdir, @global_module_path)
else
nil
end
end

Expand Down Expand Up @@ -257,8 +253,6 @@ def validated_directory(envdir)
envdir = Puppet::Environments::Directories.real_path(envdir).to_s
if Puppet::FileSystem.directory?(envdir) && Puppet::Node::Environment.valid_name?(env_name)
envdir
else
nil
end
end

Expand Down Expand Up @@ -325,8 +319,7 @@ class DefaultCacheExpirationService
# Called when the environment is created.
#
# @param [Puppet::Node::Environment] env
def created(env)
end
def created(env); end

# Is the environment with this name expired?
#
Expand All @@ -339,8 +332,7 @@ def expired?(env_name)
# The environment with this name was evicted.
#
# @param [Symbol] env_name The symbolic environment name
def evicted(env_name)
end
def evicted(env_name); end
end

def self.cache_expiration_service=(service)
Expand Down Expand Up @@ -536,8 +528,7 @@ def initialize(value)
@guards = 0
end

def touch
end
def touch; end

def expired?(now)
false
Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/face/epp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,6 @@ def effective_template(file, env)
template_file
elsif Puppet::FileSystem.exist?(file)
file
else
nil
end
end
end
2 changes: 0 additions & 2 deletions lib/puppet/file_bucket/dipper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ def restore(file, sum)
return nil
end
newsum
else
nil
end
end

Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/file_serving/content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def self.from_binary(content)

# This is no longer used, but is still called by the file server implementations when interacting
# with their model abstraction.
def collect(source_permissions = nil)
end
def collect(source_permissions = nil); end

# Read the content of our file in.
def content
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/file_serving/mount.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ def to_s
end

# A noop.
def validate
end
def validate; end
end
2 changes: 0 additions & 2 deletions lib/puppet/gettext/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ def self.puppet_locale_path
WINDOWS_PATH
elsif !Puppet::Util::Platform.windows? && Puppet::FileSystem.exist?(POSIX_PATH)
POSIX_PATH
else
nil
end
end

Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/graph/simple_graph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,6 @@ def path_between(f, t)
elsif dependents(f).include?(t)
m = (dependents(f) & direct_dependencies_of(t)).first
path_between(f, m) + path_between(m, t)
else
nil
end
end

Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/indirector/file_bucket_file/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ def find(request)
Puppet.info _("FileBucket read %{checksum}") % { checksum: checksum }
model.new(Puppet::FileSystem.binread(contents_file))
end
else
nil
end
end

Expand Down
7 changes: 1 addition & 6 deletions lib/puppet/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ def puppetversion
end

# @deprecated The puppetversion module metadata field is no longer used.
def puppetversion=(something)
end
def puppetversion=(something); end

# @deprecated The puppetversion module metadata field is no longer used.
def validate_puppet_version
Expand Down Expand Up @@ -172,8 +171,6 @@ def task_file(name)

if Puppet::FileSystem.exist?(full_path)
full_path
else
nil
end
end

Expand Down Expand Up @@ -205,8 +202,6 @@ def plan_file(name)

if Puppet::FileSystem.exist?(full_path)
full_path
else
nil
end
end

Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/parser/ast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def inspect

# Evaluate the current object. Just a stub method, since the subclass
# should override this method.
def evaluate(scope)
end
def evaluate(scope); end

# The version of the evaluate method that should be called, because it
# correctly handles errors. It is critical to use this method because
Expand Down
3 changes: 1 addition & 2 deletions lib/puppet/parser/compiler/catalog_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ def initialize(catalog)
end

# Validate some aspect of the catalog and raise a `CatalogValidationError` on failure
def validate
end
def validate; end
end

class CatalogValidationError < Puppet::Error
Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/parser/files.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ def find_in_module(reference, environment)

if file && mod
yield(mod, file)
else
nil
end
end
end
Expand Down
4 changes: 0 additions & 4 deletions lib/puppet/parser/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ def [](param)

if @parameters.has_key?(param)
@parameters[param].value
else
nil
end
end

Expand Down Expand Up @@ -90,7 +88,6 @@ def evaluate
def exported=(value)
if value
@virtual = true
else
end
@exported = value
end
Expand Down Expand Up @@ -226,7 +223,6 @@ def to_hash
if value.is_a?(Array)
value = value.flatten.reject { |v| v.nil? || :undef == v }
end
else
end
result[param.name] = value
end)
Expand Down
6 changes: 1 addition & 5 deletions lib/puppet/parser/scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,6 @@ def self.number?(value)
value.to_i(8)
when /^-?\d+$/
value.to_i
else
nil
end
end

Expand Down Expand Up @@ -566,8 +564,6 @@ def [](varname, options = EMPTY_HASH)
def inherited_scope
if resource && resource.type == TYPENAME_CLASS && !resource.resource_type.parent.nil?
qualified_scope(resource.resource_type.parent)
else
nil
end
end

Expand Down Expand Up @@ -680,7 +676,7 @@ def to_hash(recursive = true, include_undef = false)
target.merge!(inherited.to_hash(recursive))
end
else
target = Hash.new
target = {}
end

# add all local scopes
Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/pops/adaptable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ def self.clear(o)
attr_name = self_attr_name
if o.instance_variable_defined?(attr_name)
o.send(:remove_instance_variable, attr_name)
else
nil
end
end

Expand Down
Loading