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
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,8 @@ Style/HashAsLastArrayItem:
Enabled: false
Style/HashLikeCase:
Enabled: false
Style/HashSyntax:
Enabled: false
Style/HashTransformKeys:
Enabled: false
Style/HashTransformValues:
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/functions/inifile/create_ini_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def default_impl(settings, defaults = {})
resources = settings.keys.each_with_object({}) do |section, res|
unless settings[section].is_a?(Hash)
raise(Puppet::ParseError,
_('create_ini_settings(): Section %{section} must contain a Hash') % { section: })
_('create_ini_settings(): Section %{section} must contain a Hash') % { section: section })
end

path = defaults.merge(settings)['path']
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/ini_setting/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def self.instances
resources.push(
new(
name: namevar(section_name, setting),
value:,
value: value,
ensure: :present,
),
)
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/ini_setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def munge_boolean_md5(value)
newparam(:path) do
desc 'The ini file Puppet will ensure contains the specified setting.'
validate do |value|
raise(Puppet::Error, _("File paths must be fully qualified, not '%{value}'") % { value: }) unless Puppet::Util.absolute_path?(value)
raise(Puppet::Error, _("File paths must be fully qualified, not '%{value}'") % { value: value }) unless Puppet::Util.absolute_path?(value)
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/ini_subsetting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def munge_boolean_md5(value)
newparam(:path) do
desc 'The ini file Puppet will ensure contains the specified setting.'
validate do |value|
raise(Puppet::Error, _("File paths must be fully qualified, not '%{value}'") % { value: }) unless Puppet::Util.absolute_path?(value)
raise(Puppet::Error, _("File paths must be fully qualified, not '%{value}'") % { value: value }) unless Puppet::Util.absolute_path?(value)
end
end
newparam(:show_diff) do
Expand Down
8 changes: 4 additions & 4 deletions lib/puppet/util/ini_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def set_value(*args)
end

complete_setting = {
setting:,
separator:,
value:
setting: setting,
separator: separator,
value: value
}
add_section(Section.new(section_name, nil, nil, nil, nil)) unless @sections_hash.key?(section_name)

Expand Down Expand Up @@ -283,7 +283,7 @@ def find_commented_setting(section, setting)

(section.start_line..section.end_line).each do |line_num|
next unless (match = @commented_setting_regex.match(lines[line_num]))
return { match:, line_num: } if match[3] == setting
return { match: match, line_num: line_num } if match[3] == setting
end
nil
end
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/provider/ini_setting/ruby_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ def self.file_path
expected = orig_content
{ 'section' => { 'first' => 1 } }.each_pair do |section, settings|
settings.each_pair do |setting, value|
resource = Puppet::Type::Ini_setting.new(common_params.merge(section:, setting:, value:))
resource = Puppet::Type::Ini_setting.new(common_params.merge(section: section, setting: setting, value: value))
provider = described_class.new(resource)
expect(provider.exists?).to be false
# byebug
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/puppet/type/ini_setting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

describe ini_setting do
describe 'path validation' do
subject(:ini_setting_path) { described_class.new(name: 'foo', path:) }
subject(:ini_setting_path) { described_class.new(name: 'foo', path: path) }

context 'when on posix platforms' do
before(:each) do
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/puppet/type/ini_subetting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

describe ini_subsetting do
describe 'quote_char validation' do
subject(:ini_subsetting_test) { described_class.new(name: 'foo', path:, quote_char:) }
subject(:ini_subsetting_test) { described_class.new(name: 'foo', path: path, quote_char: quote_char) }

context 'when on posix platforms' do
let(:path) { '/absolute/path' }
Expand All @@ -17,7 +17,7 @@
end

describe 'path validation' do
subject(:ini_subsetting_test) { described_class.new(name: 'foo', path:) }
subject(:ini_subsetting_test) { described_class.new(name: 'foo', path: path) }

context 'when on posix platforms' do
before(:each) do
Expand Down