Skip to content

Commit

Permalink
Layout/EmptyLinesAroundAccessModifier
Browse files Browse the repository at this point in the history
This commit enables the Rubocop Layout/EmptyLinesAroundAccessModifier
cop.
  • Loading branch information
mhashizume committed Dec 18, 2023
1 parent 52f0ee4 commit c91eb96
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Layout/EmptyLineBetweenDefs:
Layout/EmptyLines:
Enabled: true

Layout/EmptyLinesAroundAccessModifier:
Enabled: true

# puppet uses symbol booleans in types and providers to work around long standing
# bugs when trying to manage falsey pararameters and properties
Lint/BooleanSymbol:
Expand Down
6 changes: 0 additions & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ Layout/EmptyLineAfterGuardClause:
Layout/EmptyLineAfterMagicComment:
Enabled: false

# This cop supports safe auto-correction (--auto-correct).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: around, only_before
Layout/EmptyLinesAroundAccessModifier:
Enabled: false

# This cop supports safe auto-correction (--auto-correct).
Layout/EmptyLinesAroundArguments:
Exclude:
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/file_bucket/dipper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def list(fromdate, todate)
end

private

def absolutize_path( path )
Pathname.new(path).realpath
end
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/file_system/posix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def compare_stream(path, stream)
end

private

def stream_blksize(*streams)
streams.each do |s|
next unless s.respond_to?(:stat)
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/interface.rb
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ def deprecated?
# to be unrecognizable in the final outcome. At which point we will throw
# all this away, replace it with something nice, and work out if we should
# be making this visible to the outside world... --daniel 2011-04-14

private

# @return [void]
# @api private
def __invoke_decorations(type, action, passed_args = [], passed_options = {})
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/interface/action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ def validate_and_clean(original)
# Support code for action decoration; see puppet/interface.rb for the gory
# details of why this is hidden away behind private. --daniel 2011-04-15
private

# @return [void]
# @api private
def __add_method(name, proc)
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/interface/action_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def render_as(value = nil)
end

private

def initialize(face, name, &block)
@face = face
@action = Puppet::Interface::Action.new(face, name)
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/module_tool/applications/upgrader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ def installed_release.priority
end

private

def module_repository
@repo ||= Puppet::Forge.new(Puppet[:module_repository])
end
Expand Down
3 changes: 3 additions & 0 deletions lib/puppet/pops/types/types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ def callable_args?(callable_t, guard)
DEFAULT = PUndefType.new

protected

# @api private
def _assignable?(o, guard)
o.is_a?(PUndefType)
Expand Down Expand Up @@ -680,6 +681,7 @@ def instance?(o, guard = nil)
DEFAULT = PDefaultType.new

protected

# @api private
def _assignable?(o, guard)
o.is_a?(PDefaultType)
Expand Down Expand Up @@ -3140,6 +3142,7 @@ def instance?(o, guard = nil)
end

protected

# @api private
def _assignable?(o, guard)
o.is_a?(PCatalogEntryType)
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/provider/file/windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ def munge_windows_system_group(current, should)
end

attr_reader :file

private

def file
@file ||= Puppet::FileSystem.pathname(resource[:path])
end
Expand Down
2 changes: 2 additions & 0 deletions lib/puppet/provider/package/portage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def latest
end

private

def eix_get_version_for_versions(versions, target)
# [2.7.10-r1,2.7.12,3.4.3-r1,3.4.5,3.5.2] 3.5.2
return nil if versions.nil?
Expand All @@ -249,6 +250,7 @@ def eix_get_version_for_versions(versions, target)
end

private

def eix_get_version_for_slot(versions_and_slots, slot)
# [2.7.12:2.7 3.4.5:3.4 3.5.2:3.5] 3.5
return nil if versions_and_slots.nil?
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/provider/package/rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ def insync?(is)
end

private

# @param line [String] one line of rpm package query information
# @return [Hash] of NEVRA_FIELDS strings parsed from package info
# or an empty hash if we failed to parse
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/provider/service/upstart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def status
end

private

def is_upstart?(script = initscript)
Puppet::FileSystem.exist?(script) && script.match(/\/etc\/init\/\S+\.conf/)
end
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/settings/file_setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def value
end

private

def safe_to_use_settings_value?
@settings[:mkusers] or @settings.send(@available_method)
end
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/type/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ def current_username
end

private

def set_sensitive_parameters(sensitive_parameters)
# If any are sensitive, mark all as sensitive
sensitive = false
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/util/inifile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def format
end

private

def find_entry(key)
@entries.each do |entry|
return entry if entry.is_a?(Array) && entry[0] == key
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/util/posix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def groups_of(user)
end

private

def get_groups_list(user)
raise LoadError, "The 'getgrouplist' method is not available" unless Puppet::FFI::POSIX::Functions.respond_to?(:getgrouplist)

Expand Down
1 change: 1 addition & 0 deletions lib/puppet/util/windows/eventlog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def to_native(level)
end

private

# For the purposes of allowing this class to be standalone, the following are
# duplicate definitions from elsewhere in Puppet:

Expand Down
1 change: 1 addition & 0 deletions util/rspec_grouper
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module Parallel
end

private

def count_examples(group)
return 0 unless group
# Each group can have examples as well as child groups, so recursively traverse
Expand Down

0 comments on commit c91eb96

Please sign in to comment.