hooks icon indicating copy to clipboard operation
hooks copied to clipboard

[conan center] check SPDX id

Open SSE4 opened this issue 6 years ago • 5 comments

this is very common error that license identifier is misspelled, probably would be nice to issue a warning in conan-center hook

SSE4 avatar Nov 06 '19 14:11 SSE4

we already have the spdx_checker hook, so it just needs to be invoked and interpreted as a potential warning I guess

or merged into the conan-center hook for that matter, but that might be a bad idea 🤔

Croydon avatar Nov 06 '19 16:11 Croydon

@danimtb Could we enable spdx_checker hook there in CI? Note, it requires spdx_lookup python package.

uilianries avatar Feb 26 '20 21:02 uilianries

I would suggest to wait with enabling until spdx_lookup is updated.

That is something that I have now on my personal to do list for a long time, but never came around to do it

spdx_lookup is currently using an old version of the SPDX data, resulting in outdated results

Identifier as ...-2.0-only or ..-or-later are currently reported as an error while the outdated ones are reported as successful

See e.g. https://github.com/bbqsrc/spdx-lookup-python/issues/1

Croydon avatar Feb 26 '20 21:02 Croydon

@Croydon thanks for bringing us this information!

uilianries avatar Feb 26 '20 21:02 uilianries

I think there's a bug also in the current license checker hook @ https://github.com/conan-io/hooks/blob/master/hooks/spdx_checker.py#L16 .. that will fail because license property is not exposed in the dict and accessing it directly w/ conanfile.license will throw AttributeError. Didn't try but i guess that should be changed to getattr(conanfile, "license", None) and checking if anything came out from the getattr() call ? =)

rasjani avatar Mar 16 '20 17:03 rasjani