Skip to content

Commit

Permalink
fix too greedy regular expression
Browse files Browse the repository at this point in the history
  • Loading branch information
tmu-sprd committed Apr 4, 2024
1 parent 1e10b52 commit ca17207
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/puppet-syntax/hiera.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def check(filelist)
# You can do string concatenation outside of {}:
# "%{lookup('this_is_ok')}:3306"
def check_broken_function_call(element)
'string after a function call but before `}` in the value' if element.is_a?(String) && /%{.+\('.*'\).+}/.match?(element)
'string after a function call but before `}` in the value' if element.is_a?(String) && /%{[^}]+\('[^}]*'\)[^}\s]+}/.match?(element)
end

# gets a hash or array, returns all keys + values as array
Expand Down

0 comments on commit ca17207

Please sign in to comment.