Skip to content

Commit

Permalink
_cli: fix --desc auto's behavior with --format json (#399)
Browse files Browse the repository at this point in the history
* _cli: fix `--desc auto`'s behavior with `--format json`

Signed-off-by: William Woodruff <[email protected]>

* CHANGELOG: record fix

Signed-off-by: William Woodruff <[email protected]>

Signed-off-by: William Woodruff <[email protected]>
  • Loading branch information
woodruffw authored Nov 2, 2022
1 parent c3b00cf commit 17f679e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pip_audit/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 17f679e

Please sign in to comment.