File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ def _parser() -> argparse.ArgumentParser: # pragma: no cover
378378 metavar = "ID" ,
379379 action = "append" ,
380380 dest = "ignore_vulns" ,
381- default = [] ,
381+ default = os . environ . get ( "PIP_AUDIT_IGNORE_VULNS" , "" ). split () ,
382382 help = (
383383 "ignore a specific vulnerability by its vulnerability ID; "
384384 "this option can be used multiple times"
Original file line number Diff line number Diff line change @@ -222,6 +222,7 @@ def test_environment_variable(monkeypatch):
222222 monkeypatch .setenv ("PIP_AUDIT_OUTPUT" , "/tmp/fake" )
223223 monkeypatch .setenv ("PIP_AUDIT_PROGRESS_SPINNER" , "off" )
224224 monkeypatch .setenv ("PIP_AUDIT_VULNERABILITY_SERVICE" , "osv" )
225+ monkeypatch .setenv ("PIP_AUDIT_IGNORE_VULNS" , "cve ghsa xyz" )
225226
226227 parser = pip_audit ._cli ._parser ()
227228 monkeypatch .setattr (pip_audit ._cli , "_parse_args" , lambda * a : parser .parse_args ([]))
@@ -232,3 +233,4 @@ def test_environment_variable(monkeypatch):
232233 assert args .output == Path ("/tmp/fake" )
233234 assert not args .progress_spinner
234235 assert args .vulnerability_service == VulnerabilityServiceChoice .Osv
236+ assert args .ignore_vulns == ["cve" , "ghsa" , "xyz" ]
You can’t perform that action at this time.
0 commit comments