onefetch icon indicating copy to clipboard operation
onefetch copied to clipboard

[Feature] Add support for the WTFPL license

Open TangHanchen opened this issue 2 weeks ago • 5 comments

Summary 💡

Until now, WTFPL hasn’t been supported by onefetch. Hopefully, this license can also be correctly recognized by onefetch.

Motivation 🔦

There are indeed quite a few projects using the WTFPL license in tens of thousands of warehouses worldwide, and I think adding support for the WTFPL license would be beneficial for onefetch.

TangHanchen avatar Nov 18 '26 11:11 TangHanchen

I was going to tell you to raise an issue at askalono, but it's been archived 🙃

I guess we have some choices:

  • Just live with the fact that askalono probably won't get updates ever again.
  • Search for a new tool to identify licenses.
  • Write our own version (and then we can implement this feature request).

Personally I'm leaning towards writing our own version. I don't think perfect, 100% accuracy is necessary, and we can write a simplified version that just maps unique strings and/or regular expressions to license identifiers.

@o2sh What do you think? Also, can we just update resources/license.cache.zstd ourselves to add support for new licenses? I'm not sure where that file comes from.

spenserblack avatar Nov 18 '26 13:11 spenserblack

Seems like WTFPL is already supported, I tested it on a few repos:

https://github.com/preservim/nerdtree

image

https://github.com/denysdovhan/wtfjs

image

To reproduce the issue we need an example of a repo where the license wasn't detected. @TangHanchen can you provide that?

@spenserblack I updated the license cache in 3054de77f95a82bf4af3a6cc34649c037342ed4e it comes from https://github.com/spdx/license-list-data/tree/main/json/details

o2sh avatar Nov 18 '26 14:11 o2sh

Thanks @o2sh

:thinking: What's the output of onefetch --version, @TangHanchen? Have you tried using the latest version?

spenserblack avatar Nov 18 '26 14:11 spenserblack

I built it from the source code, and it can already recognize WTFPL normally. Big thanks to o2sh!

TangHanchen avatar Nov 20 '26 11:11 TangHanchen

image

TangHanchen avatar Nov 20 '26 11:11 TangHanchen