spdx / ntia-conformance-checker

Check SPDX SBOM for NTIA minimum elements

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ntia-checker --version does not give the version

vargenau opened this issue · comments

ntia-checker --version

does not give the version.

You have to give a fake file for it to work:

ntia-checker --version --file foobar
0.5.1

Thanks, @vargenau, for the bug report. We'll investigate!

The --file argument was required. Oops. PR #151 fixes this. Thank you again, @vargenau, for reporting this bug.

Hello @jspeed-meyers

This fixes the issue, but creates another one.

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

@vargenau, does PR #154 accomplish what you expect?