Skip to content

Commit 954bafb

Browse files
committed
Reformat a code block to use next unless
This should be no difference in execution, but it pleases Rubocop in the next commit when some code is added and makes review easier.
1 parent c362aa6 commit 954bafb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/puppet-lint.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@ def report(problems)
158158

159159
message[:KIND] = message[:kind].to_s.upcase
160160

161-
if message[:kind] == :fixed || [message[:kind], :all].include?(configuration.error_level)
162-
if configuration.json
163-
message['context'] = get_context(message) if configuration.with_context
164-
json << message
165-
else
166-
format_message(message)
167-
print_context(message) if configuration.with_context
168-
end
161+
next unless message[:kind] == :fixed || [message[:kind], :all].include?(configuration.error_level)
162+
163+
if configuration.json
164+
message['context'] = get_context(message) if configuration.with_context
165+
json << message
166+
else
167+
format_message(message)
168+
print_context(message) if configuration.with_context
169169
end
170170
end
171171
puts JSON.pretty_generate(json) if configuration.json

0 commit comments

Comments
 (0)