Skip to content

Commit 59371b7

Browse files
authored
Merge pull request #448 from Sharpie/backport-fix-rubocop-1862-lint
8.x Backport: Fix rubocop 1.86.2 lint
2 parents b0fb497 + 027aa12 commit 59371b7

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

lib/puppet/pops/lookup/sub_lookup.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ module SubLookup
2121
def split_key(key)
2222
return [key] if key.match(SPECIAL).nil?
2323

24+
# Rubocop 1.86.2 starts mis-classifying the "raise yield" constructions as a failure.
25+
# rubocop:disable Lint/ParenthesesAsGroupedExpression
2426
segments = key.split(/(\s*"[^"]+"\s*|\s*'[^']+'\s*|[^'".]+)/)
2527
if segments.empty?
2628
# Only happens if the original key was an empty string
@@ -45,6 +47,7 @@ def split_key(key)
4547
else
4648
raise yield('Syntax error')
4749
end
50+
# rubocop:enable Lint/ParenthesesAsGroupedExpression
4851
end
4952

5053
# Perform a sub-lookup using the given _segments_ to access the given _value_. Each segment must be a string. A string

lib/puppet/util/fileparsing.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ def initialize(type,
103103
# Convert a record into a line by joining the fields together appropriately.
104104
# This is pulled into a separate method so it can be called by the hooks.
105105
def join(details)
106-
joinchar = self.joiner
106+
joinchar = joiner
107107

108108
fields.filter_map { |field|
109109
# If the field is marked absent, use the appropriate replacement
110110
if details[field] == :absent or details[field] == [:absent] or details[field].nil?
111-
if self.optional.include?(field)
112-
self.absent
111+
if optional.include?(field)
112+
absent
113113
else
114114
raise ArgumentError, _("Field '%{field}' is required") % { field: field }
115115
end

0 commit comments

Comments
 (0)