pkgcheck
pkgcheck copied to clipboard
Check for likely typos of reserved names
We could check for unrecognised variables with a small (1 or 2) Levenshtein distance to reserved names.
[07:09] <sam_> arthurzam: as a result of the SemiReservedName check, we can also do stuff like warn on BDEPEND="${EDEPEND} ..." as a likely typo of e.g. RDEPEND
[07:09] <sam_> i've never seen that in the wild though
[07:09] <sam_> i've seen BEPEND a lot
[07:09] <sam_> I fix a few of those every 6 months
[07:12] <dwfreed> yeah, setting or using a var with a low (1 or 2) levenshtein distance to an actual reserved var but isn't one would be a good check too
[07:12] <dwfreed> could also take into account set-but-not-used and used-but-not-set if you've got the whole AST
[07:13] <dwfreed> (levenshtein distance == how many changes you must make to a word to make a target word; BEPEND and EDEPEND both have a distance of 1 to a PMS var)
See also https://github.com/pkgcore/pkgcheck/issues/262.