Skip to content

Commit

Permalink
Layout/EmptyLinesAroundMethodBody
Browse files Browse the repository at this point in the history
This commit enables the Rubocop Layout/EmptyLinesAroundMethodBody cop
and addresses all offenses.
  • Loading branch information
mhashizume committed Dec 19, 2023
1 parent f72d69d commit d004506
Show file tree
Hide file tree
Showing 30 changed files with 0 additions and 35 deletions.
4 changes: 0 additions & 4 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,6 @@ Layout/EmptyLineAfterGuardClause:
Layout/EmptyLineAfterMagicComment:
Enabled: false

# This cop supports safe auto-correction (--auto-correct).
Layout/EmptyLinesAroundMethodBody:
Enabled: false

# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,6 @@ def deprecated?
# @return [void]
# @api public
def run

# I don't really like the names of these lifecycle phases. It would be nice to change them to some more meaningful
# names, and make deprecated aliases. --cprice 2012-03-16

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/configurer/downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def evaluate

def initialize(name, path, source, ignore = nil, environment = nil, source_permissions = :ignore)
@name, @path, @source, @ignore, @environment, @source_permissions = name, path, source, ignore, environment, source_permissions

end

def file
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/datatypes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def self.create_type(type_name, &block)
rescue StandardError => e
raise ArgumentError, _("Data Type Load Error for type '%{type_name}': %{message}") % {type_name: type_name, message: e.message}
end

end

def self.create_loaded_type(type_name, loader, &block)
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/external/dot.rb
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ def pop
end

def to_s(t = '')

# This code is totally incomprehensible; it needs to be replaced!

label = @options['shape'] != 'record' && @ports.length == 0 ?
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/forge/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def initialize(options)
#
# @return [String] the multiline version of the error message
def multiline

message = []
message << _('Request to Puppet Forge failed.')
message << _(' The server being queried was %{uri}') % { uri: @uri }
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/interface/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ def deprecated?
attr_reader :when_invoked

def when_invoked=(block)

internal_name = "#{@name} implementation, required on Ruby 1.8".to_sym

arity = @positional_arg_count = block.arity
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/module_tool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ def self.set_option_defaults(options)

# Note: environment will have expanded the path
options[:target_dir] = face_environment.full_modulepath.first

end

# Given a hash of options, we should discover or create a
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/parser/ast/pops_bridge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def initialize(program_model, context = {})
# efficient as it avoids one full scan of all logic via recursive enumeration/yield)
#
def instantiate(modname)

@program_model.definitions.map do |d|
case d
when Puppet::Pops::Model::HostClassDefinition
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pops/evaluator/runtime3_resource_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module Runtime3ResourceSupport
CLASS_STRING = 'class'

def self.create_resources(file, line, scope, virtual, exported, type_name, resource_titles, evaluated_parameters)

env = scope.environment
# loader = Adapters::LoaderAdapter.loader_for_model_object(o, scope)

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pops/functions/dispatcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def find_matching_dispatcher(args, &block)
#
# @api private
def dispatch(instance, calling_scope, args, &block)

dispatcher = find_matching_dispatcher(args, &block)
unless dispatcher
args_type = Puppet::Pops::Types::TypeCalculator.singleton.infer_set(block_given? ? args + [block] : args)
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pops/functions/function.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def self.signatures
#
# @api public
def internal_call_function(scope, function_name, args, &block)

the_loader = loader
unless the_loader
raise ArgumentError, _("Function %{class_name}(): cannot call function '%{function_name}' - no loader specified") %
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pops/pcore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def self.init(loader, ir)
}
}
PUPPET

end

# Create and register a new `Object` type in the Puppet Type System and map it to an implementation class
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/package/apt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def install
raise Puppet::Error, _("Failed to update to version %{should}, got version %{version} instead") % { should: should, version: version } unless
insync?(version)
end

end

# What's the latest package version available?
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/package/blastwave.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def self.blastlist(hash)
}
return list
end

end

# Split the different lines into hashes.
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/package/pkgin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
has_feature :installable, :uninstallable, :upgradeable, :versionable

def self.parse_pkgin_line(package)

# e.g.
# vim-7.2.446;Vim editor (vi clone) without GUI
match, name, version, status = *package.match(/([^\s;]+)-([^\s;]+)[;\s](=|>|<)?.+$/)
Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/provider/package/yum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ def self.prefetch(packages)
# @param disableexcludes [Array<String>] A list of repository excludes to disable for this query
# @return [Hash<Symbol, String>]
def self.latest_package_version(package, disablerepo, enablerepo, disableexcludes)

key = [disablerepo, enablerepo, disableexcludes]

@latest_versions ||= {}
Expand Down Expand Up @@ -149,7 +148,6 @@ def self.parse_updates(str)
end

def self.update_to_hash(pkgname, pkgversion)

# The pkgname string has two parts: name, and architecture. Architecture
# is the portion of the string following the last "." character. All
# characters preceding the final dot are the package name. Parse out
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/provider/package/zypper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def uninstall

zypper(*options)
end

end

def insync?(is)
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/resource/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def child_of?(klass)

# Now evaluate the code associated with this class or definition.
def evaluate_code(resource)

static_parent = evaluate_parent_type(resource)
scope = static_parent || resource.scope

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ def unsafe_clear(clear_cli = true, clear_application_defaults = false)
#
# @api private
def clear_environment_settings(environment)

if environment.nil?
return
end
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/ssl/certificate_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ def extension_request_attribute(options)
# @return [Array<Array<Object>>] A array of arrays containing the extension
# OID the critical state if present, and the extension value.
def unpack_extension_request(attribute)

unless attribute.value.is_a? OpenSSL::ASN1::Set
raise Puppet::Error, _("In %{attr}, expected Set but found %{klass}") % { attr: attribute.oid, klass: attribute.value.class }
end
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ def failed_dependencies?(resource)
# up-front at failure time because the graph may be mutated as we
# walk it.
def propagate_failure(resource)

provider_class = resource.provider.class
s = resource_status(resource)
if prefetch_failed_providers[resource.type][provider_class.name] && !s.nil?
Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2220,7 +2220,6 @@ def self.initvars
}

@doc ||= ""

end

# Returns the name of this type (if specified) or the parent type #to_s.
Expand Down Expand Up @@ -2278,7 +2277,6 @@ def self.validate(&block)
# @return [void]
#
def log(msg)

Puppet::Util::Log.create(
:level => @parameters[:loglevel].value,
:message => msg,
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/type/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ def self.mkdefaultschedules
end

def match?(previous = nil, now = nil)

# If we've got a value, then convert it to a Time instance
previous &&= Time.at(previous)

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/util/command_line/puppet_option_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def initialize(usage_msg = nil)
@parser = Trollop::Parser.new do
banner usage_msg
end

end

# This parameter, if set, will tell the underlying option parser not to throw an
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/util/log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class Puppet::Util::Log

# Create a new destination type.
def self.newdesttype(name, options = {}, &block)

dest = genclass(
name,
:parent => Puppet::Util::Log::Destination,
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/util/rdoc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module Puppet::Util::RDoc
# launch a rdoc documentation process
# with the files/dir passed in +files+
def rdoc(outputdir, files, charset = nil)

# then rdoc
require 'rdoc/rdoc'
require 'rdoc/options'
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/util/rdoc/parser/puppet_parser_core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def find_object_named(container, name)

# walk down the namespace and lookup/create container as needed
def get_class_or_module(container, name)

# class ::A -> A is in the top level
if name =~ /^::/
container = @top_level
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/util/reference.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def self.pdf(text)
Dir.chdir("/tmp") do
%x{texi2pdf puppetdoc.tex >/dev/null 2>/dev/null}
end

end

def self.references(environment)
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/util/windows/sid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def ads_to_principal(ads_object)
# e.g. 'BUILTIN\Administrators'. Returns nil if an account
# for that SID does not exist.
def sid_to_name(value)

sid_bytes = []
begin
string_to_sid_ptr(value) do |ptr|
Expand Down

0 comments on commit d004506

Please sign in to comment.