sonatype-nexus-community / jake

Check your Python environments for vulnerable Open Source packages with OSS Index or Sonatype Nexus Lifecycle.
https://jake.readthedocs.io/
Apache License 2.0
111 stars 24 forks source link

[BUG] Typo in --schema-version argument #117

Closed vikiscience closed 2 years ago

vikiscience commented 2 years ago

Hello All,

since the version 2.0 of jake, there is a typo in a --schema-version command line argument:

https://github.com/sonatype-nexus-community/jake/blob/main/jake/command/oss.py#L238

This typo leads to an error, where the version gets to be V1_4), instead of V1_4, see error trace:

Traceback (most recent call last):
  File "/usr/local/bin/jake", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/jake/app.py", line 106, in main
    JakeCmd(args).execute()
  File "/usr/local/lib/python3.8/site-packages/jake/app.py", line 80, in execute
    exit_code: int = command.execute(arguments=self._arguments)
  File "/usr/local/lib/python3.8/site-packages/jake/command/__init__.py", line 43, in execute
    return self.handle_args()
  File "/usr/local/lib/python3.8/site-packages/jake/command/oss.py", line 183, in handle_args
    schema_version=SchemaVersion['V{}'.format(
  File "/usr/local/lib/python3.8/enum.py", line 387, in __getitem__
    return cls._member_map_[name]
KeyError: 'V1_4)'

Would be great to have a fix, since it's a tiny change (I can contribute a PR too, if needed).

madpah commented 2 years ago

Thanks for reporting this @vikiscience - jake 2.1.1 has been released which addresses this!