rpmlint
rpmlint copied to clipboard
Provide did-you-mean functionality.
Hey there, just gauging interest as this is something I might want to add to rpmlint
. As a starting packager some of the warnings such as the following:
python-token_bucket.src: W: invalid-license Apache 2
make it hard to find the list of valid licenses that should be used. I propose a few solutions for this to see which you'd prefer:
- Provide the list of valid licenses (or the location of where to find this list).
- Perform a quick spellcheck on the licenses, and list those with the shortest edit distance.
- Allow for common-mistakes (perhaps hard to define) that would directly show the substitute. e.g. a regular expression on license-name that matches
Apache
would directly suggestASL 2
.
My personal preference would go towards 1, and perhaps 2. Option 3 seems too cumbersome to maintain.
make it hard to find the list of valid licenses that should be used. I propose a few solutions for this to see which you'd prefer:
- Provide the list of valid licenses (or the location of where to find this list).
Sure, please use --expain
option for for that.
- Perform a quick spellcheck on the licenses, and list those with the shortest edit distance.
Feel free to come up with a pull request, python provides pretty nice functionality for it: https://docs.python.org/3/library/difflib.html
Anyway, thanks for the report and tell me please if my suggestion helps?
Yea that helps, the --explain
functionality I hadn't seen yet and that pretty much negates the first suggestion.
For the second one I'm on track to get you a PR, just minor tidbits to do. I'm a bit worried that adding informational output might break builds?
python-token_bucket.src: I: invalid-license-spellcheck BSD, DSL, 0BSD
python-token_bucket.src: W: invalid-license BDS
Just some edge case handling and the order of the messages to do there.
Yea that helps, the
--explain
functionality I hadn't seen yet and that pretty much negates the first suggestion.
Great!
For the second one I'm on track to get you a PR, just minor tidbits to do. I'm a bit worried that adding informational output might break builds?
How would it break builds?
python-token_bucket.src: I: invalid-license-spellcheck BSD, DSL, 0BSD python-token_bucket.src: W: invalid-license BDS
I can also imagine something like python-token_bucket.src: W: invalid-license BDS (did you mean BSD or DSL)
or something like that?
Just some edge case handling and the order of the messages to do there.