Skip to content

Commit

Permalink
Always return an array of problems in report
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl authored and alexjfisher committed Feb 14, 2023
1 parent e69de47 commit 7729aa1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/puppet-lint.rb
Expand Up @@ -170,6 +170,8 @@ def print_context(message)
# Returns array of problem.
def report(problems)
json = []
print_stdout = !(configuration.json || configuration.sarif)

problems.each do |message|
next if message[:kind] == :ignored && !PuppetLint.configuration.show_ignored

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

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

if configuration.json || configuration.sarif || configuration.codeclimate_report_file
json << message
end
json << message

unless configuration.json || configuration.sarif
if print_stdout
format_message(message)
print_github_annotation(message) if configuration.github_actions
end
Expand Down

0 comments on commit 7729aa1

Please sign in to comment.