Skip to content

Commit

Permalink
Layout/EmptyLinesAroundModuleBody
Browse files Browse the repository at this point in the history
This commit enables the Rubocop Layout/EmptyLinesAroundModuleBody cop
and addresses all offenses.
  • Loading branch information
mhashizume committed Dec 19, 2023
1 parent ff22ec8 commit 584abe3
Show file tree
Hide file tree
Showing 109 changed files with 0 additions and 133 deletions.
6 changes: 0 additions & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ Layout/EmptyLineAfterGuardClause:
Layout/EmptyLineAfterMagicComment:
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
Layout/EmptyLinesAroundModuleBody:
Enabled: false

# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EnforcedStyleAlignWith, Severity.
# SupportedStylesAlignWith: keyword, variable, start_of_line
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/agent/locker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ def lockfile
@lockfile
end
private :lockfile

end
1 change: 0 additions & 1 deletion lib/puppet/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
require_relative '../puppet/application_support'

module Puppet

# Defines an abstract Puppet application.
#
# # Usage
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/application_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

module Puppet
module ApplicationSupport

# Pushes a Puppet Context configured with a remote environment for an agent
# (one that exists at the master end), and a regular environment for other
# modes. The configuration is overridden with options from the command line
Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/concurrent/lock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@

module Puppet
module Concurrent

# A simple lock that at the moment only does any locking on jruby
class Lock
include Puppet::Concurrent::Synchronized
def synchronize
yield
end
end

end
end

2 changes: 0 additions & 2 deletions lib/puppet/concurrent/synchronized.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
module Puppet
module Concurrent

# Including Puppet::Concurrent::Synchronized into a class when running on JRuby
# causes all of its instance methods to be synchronized on the instance itself.
# When running on MRI it has no effect.
Expand All @@ -11,6 +10,5 @@ module Concurrent
else
module Synchronized; end
end

end
end
1 change: 0 additions & 1 deletion lib/puppet/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require_relative '../puppet/util/platform'

module Puppet

def self.default_diffargs
'-u'
end
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/environments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

# @api private
module Puppet::Environments

class EnvironmentNotFound < Puppet::Error
def initialize(environment_name, original = nil)
environmentpath = Puppet[:environmentpath]
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 @@ -8,7 +8,6 @@
# It also supports undirected edges.

module DOT

# These global vars are used to make nice graph source.

$tab = ' '
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/ffi/posix/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

module Puppet::FFI::POSIX
module Functions

extend FFI::Library

ffi_convention :stdcall
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/ffi/windows/functions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

module Puppet::FFI::Windows
module Functions

extend FFI::Library
include Puppet::FFI::Windows::Constants

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/ffi/windows/structs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

module Puppet::FFI::Windows
module Structs

extend FFI::Library
extend Puppet::FFI::Windows::APITypes

Expand Down
2 changes: 0 additions & 2 deletions lib/puppet/forge/errors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

# Puppet::Forge specific exceptions
module Puppet::Forge::Errors

# This exception is the parent for all Forge API errors
class ForgeError < Puppet::Error
# This is normally set by the child class, but if it is not this will
Expand Down Expand Up @@ -110,5 +109,4 @@ def multiline
message.join("\n")
end
end

end
1 change: 0 additions & 1 deletion lib/puppet/gettext/module_translations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require_relative '../../puppet/gettext/config'

module Puppet::ModuleTranslations

# @api private
# Loads translation files for each of the specified modules,
# if present. Requires the modules to have `forge_name` specified.
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/interface/documentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ def build_synopsis(face, action = nil, arguments = nil)
end
end
end

end

# This module can be mixed in to provide a full set of documentation
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/interface/option_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
# {Puppet::Interface.define define} block).
# @api public
module Puppet::Interface::OptionManager

# @api private
def display_global_options(*args)
@display_global_options ||= []
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/loaders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ module Loader
require_relative '../puppet/pops/loader/puppet_plan_instantiator'
end
end

end
1 change: 0 additions & 1 deletion lib/puppet/module_tool/checksums.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require_relative '../../puppet/network/format_support'

module Puppet::ModuleTool

# = Checksums
#
# This class provides methods for generating checksums for data and adding
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/module_tool/contents_description.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require_relative '../../puppet/module_tool'

module Puppet::ModuleTool

# = ContentsDescription
#
# This class populates +Metadata+'s Puppet type information.
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/module_tool/dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
require_relative '../../puppet/network/format_support'

module Puppet::ModuleTool

class Dependency
include Puppet::Network::FormatSupport

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/module_tool/errors/installer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true
module Puppet::ModuleTool::Errors

class InstallError < ModuleToolError; end

class AlreadyInstalledError < InstallError
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/module_tool/errors/shared.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true
module Puppet::ModuleTool::Errors

class NoVersionsSatisfyError < ModuleToolError
def initialize(options)
@requested_name = options[:requested_name]
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/module_tool/errors/uninstaller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true
module Puppet::ModuleTool::Errors

class UninstallError < ModuleToolError; end

class NoVersionMatchesError < UninstallError
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/module_tool/errors/upgrader.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true
module Puppet::ModuleTool::Errors

class UpgradeError < ModuleToolError
def initialize(msg)
@action = :upgrade
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/module_tool/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
require 'set'

module Puppet::ModuleTool

# This class provides a data structure representing a module's metadata.
# @api private
class Metadata
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/module_tool/shared_behaviors.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true
module Puppet::ModuleTool::Shared

include Puppet::ModuleTool::Errors

def get_local_constraints
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/network/http_pool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Puppet::Network; end
# @deprecated Use {Puppet::HTTP::Client} instead.
#
module Puppet::Network::HttpPool

@http_client_class = Puppet::Network::HTTP::Connection

def self.http_client_class
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pal/catalog_compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,5 @@ def evaluate_ast_node
internal_compiler.evaluate_ast_node
end
end

end
end
2 changes: 0 additions & 2 deletions lib/puppet/pal/compiler.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
module Puppet
module Pal

# A configured compiler as obtained in the callback from `Puppet::Pal.with_script_compiler`.
# (Later, there may also be a catalog compiler available.)
#
Expand Down Expand Up @@ -218,6 +217,5 @@ def topscope
internal_compiler.topscope
end
end

end
end
1 change: 0 additions & 1 deletion lib/puppet/pal/function_signature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,5 @@ def callables
signatures.is_a?(Puppet::Pops::Types::PVariantType) ? signatures.types : [signatures]
end
end

end
end
1 change: 0 additions & 1 deletion lib/puppet/pal/pal_impl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ module Puppet
#
# @api public
module Pal

# Defines a context in which multiple operations in an env with a script compiler can be performed in a given block.
# The calls that takes place to PAL inside of the given block are all with the same instance of the compiler.
# The parameter `configured_by_env` makes it possible to either use the configuration in the environment, or specify
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pal/plan_signature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,5 @@ def params_type
dispatcher.params_struct
end
end

end
end
2 changes: 0 additions & 2 deletions lib/puppet/pal/script_compiler.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
module Puppet
module Pal

class ScriptCompiler < Compiler
# Returns the signature of the given plan name
# @param plan_name [String] the name of the plan to get the signature of
Expand Down Expand Up @@ -69,6 +68,5 @@ def list_tasks(filter_regex = nil, error_collector = nil)
list_loadable_kind(:task, filter_regex, error_collector)
end
end

end
end
1 change: 0 additions & 1 deletion lib/puppet/pal/task_signature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,5 @@ def task
@task
end
end

end
end
2 changes: 0 additions & 2 deletions lib/puppet/parser/abstract_compiler.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

module Puppet::Parser::AbstractCompiler

# Returns the catalog for a compilation. Must return a Puppet::Resource::Catalog or fail with an
# error if the specific compiler does not support catalog operations.
#
Expand Down Expand Up @@ -33,5 +32,4 @@ def qualified_variables
def topscope
raise Puppet::DevError("Class '#{self.class}' should have implemented 'topscope'")
end

end
1 change: 0 additions & 1 deletion lib/puppet/parser/files.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true
module Puppet::Parser::Files

module_function

# Return a list of manifests as absolute filenames matching the given
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/parser/functions/split.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frozen_string_literal: true
module Puppet::Parser::Functions

newfunction(
:split, :type => :rvalue,
:arity => 2,
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/plugins/syntax_checkers.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
module Puppet::Plugins
module SyntaxCheckers

# The lookup **key** for the multibind containing syntax checkers used to syntax check embedded string in non
# puppet DSL syntax.
# @api public
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pops/adapters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#
module Puppet::Pops
module Adapters

class ObjectIdCacheAdapter < Puppet::Pops::Adaptable::Adapter
attr_accessor :cache

Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pops/evaluator/deferred_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

module Puppet::Pops
module Evaluator

class DeferredValue
def initialize(proc)
@proc = proc
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pops/evaluator/external_syntax_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ def lookup_keys_for_syntax(syntax)
end
result
end

end
1 change: 0 additions & 1 deletion lib/puppet/pops/evaluator/runtime3_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,4 @@ def self.convert_return(val3x)

@instance = self.new
end

end
2 changes: 0 additions & 2 deletions lib/puppet/pops/evaluator/runtime3_resource_support.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true
module Puppet::Pops
module Evaluator

# @api private
module Runtime3ResourceSupport
CLASS_STRING = 'class'
Expand Down Expand Up @@ -113,7 +112,6 @@ def self.find_defined_resource_type(scope, type_name)
krt.find_definition(type_name)
end
private_class_method :find_defined_resource_type

end
end
end
1 change: 0 additions & 1 deletion lib/puppet/pops/evaluator/runtime3_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module Evaluator
#
# @api private
module Runtime3Support

NAME_SPACE_SEPARATOR = '::'

# Fails the evaluation of _semantic_ with a given issue.
Expand Down
1 change: 0 additions & 1 deletion lib/puppet/pops/loader/gem_support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# and then trying to access those.
#
module Puppet::Pops::Loader::GemSupport

# Produces the root directory of a gem given as an URI (gem://gemname/optional/path), or just the
# gemname as a string.
#
Expand Down
Loading

0 comments on commit 584abe3

Please sign in to comment.