pyupio/safety

Provide terse output when no problems are found

arthurzenika opened this issue · 2 comments

  • safety version: v2.3.5
  • Python version: 3.10
  • Operating System: Ubuntu

Description

It would be nice to have an output that provides a full-report when a vulnerability is found and a single line when no vulnerabilities are found.

We run safety in a collection of lint tools and the output is too verbose (and contains red text when 0 vulnerabilities are found).

What I Did

safety check --full-report

If it helps, you can fairly trivially workaround this in shell (bash for example),

function run_safety_and_echo_on_failure() {
  output=$(safety check --full-repo 2>&1)
  exit_status=$?

  if [ $exit_status -ne 0 ]; then
    echo "$output"
  fi
}