diff --git a/lib/puppet-lint.rb b/lib/puppet-lint.rb index 3e9ac6fb..263372e3 100644 --- a/lib/puppet-lint.rb +++ b/lib/puppet-lint.rb @@ -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 @@ -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