Skip to content

Commit 736b944

Browse files
ekohlalexjfisher
authored andcommitted
Always return an array of problems in report
1 parent b89153d commit 736b944

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/puppet-lint.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ def print_context(message)
170170
# Returns array of problem.
171171
def report(problems)
172172
json = []
173+
print_stdout = !(configuration.json || configuration.sarif)
174+
173175
problems.each do |message|
174176
next if message[:kind] == :ignored && !PuppetLint.configuration.show_ignored
175177

@@ -179,11 +181,9 @@ def report(problems)
179181

180182
message[:context] = get_context(message) if configuration.with_context
181183

182-
if configuration.json || configuration.sarif || configuration.codeclimate_report_file
183-
json << message
184-
end
184+
json << message
185185

186-
unless configuration.json || configuration.sarif
186+
if print_stdout
187187
format_message(message)
188188
print_github_annotation(message) if configuration.github_actions
189189
end

0 commit comments

Comments
 (0)