From 17f679efccff92e2eefde137938005922853def7 Mon Sep 17 00:00:00 2001 From: William Woodruff Date: Wed, 2 Nov 2022 14:53:01 -0400 Subject: [PATCH] _cli: fix `--desc auto`'s behavior with `--format json` (#399) * _cli: fix `--desc auto`'s behavior with `--format json` Signed-off-by: William Woodruff * CHANGELOG: record fix Signed-off-by: William Woodruff Signed-off-by: William Woodruff --- CHANGELOG.md | 6 ++++++ pip_audit/_cli.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14246c66..57490c9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ All versions prior to 0.0.9 are untracked. ## [Unreleased] +### Fixed + +* Fixed an incorrect interaction between `--desc=auto` and `--format=json`; + `--desc=auto` now includes the description in the generated JSON report, + as intended ([#399](https://github.com/pypa/pip-audit/pull/399)) + ## [2.4.5] ### Fixed diff --git a/pip_audit/_cli.py b/pip_audit/_cli.py index 2a4d4f5d..537f6626 100644 --- a/pip_audit/_cli.py +++ b/pip_audit/_cli.py @@ -107,7 +107,7 @@ def to_bool(self, format_: OutputFormatChoice) -> bool: elif self is VulnerabilityDescriptionChoice.Off: return False elif self is VulnerabilityDescriptionChoice.Auto: - return bool(format_.value is OutputFormatChoice.Json) + return bool(format_ is OutputFormatChoice.Json) else: assert_never(self)