Bug: test the presence of the --file argument if another argument is present
jspeed-meyers opened this issue · comments
PR #151 fixes one issue, but creates another one. From @vargenau:
You should test the presence of the --file
argument if another argument is present.
If I do
ntia-checker --verbose
I now have:
Traceback (most recent call last):
File "/opt/homebrew/bin/ntia-checker", line 8, in <module>
sys.exit(main())
^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/ntia_conformance_checker/main.py", line 58, in main
sbom = SbomChecker(args.file, validate=not args.skip_validation)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/ntia_conformance_checker/sbom_checker.py", line 22, in __init__
self.doc = self.parse_file()
^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/ntia_conformance_checker/sbom_checker.py", line 47, in parse_file
if not os.path.exists(self.file):
^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen genericpath>", line 19, in exists
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
Same with just
ntia-checker
Originally posted by @vargenau in #150 (comment)
Thank you @vargenau!
To anyone reading this issue, PR welcome!