Perl files misidentified as "Raku" #6263
-
https://github.com/mauke/HTML-Blitz/search?l=raku shows that three of my Perl modules are misidentified as "Raku":
I don't understand why. From https://github.com/github/linguist/blob/c1c34e5260797b4d598f5ec76f19723bfc5a1894/lib/linguist/heuristics.yml#L815 it seems like it's looking for lines starting with |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
This will be because your files don't match any of the heuristics for the Improving the Perl heuristic would be ideal, but I doubt there's more specificity that can be added which wouldn't also apply to Raku (from my limited understanding of both languages). Adding more samples might help, but it might not given how similar Perl is to Raku. There are two solutions you can implement:
|
Beta Was this translation helpful? Give feedback.
-
Maybe it is worth always consider that the files with .pm extension is perl5? This will remove all the false positive when perl5 is incorrectly detected as raku. Such change will make raku detection worse, but the official extension for raku is .rakumod, and probably if the raku code is using .pm extension it is best to rename the file to have extension .rakumod |
Beta Was this translation helpful? Give feedback.
This will be because your files don't match any of the heuristics for the
.pm
extension so it falls through to the "last resort" classifier which will make a guess based on the samples we have for all languages that use this extension. This is far from perfect and in this case it's got it wrong three times; ie it thinks your files look more like the Raku samples than the Perl samples.Improving the Perl heuristic would be ideal, but I doubt there's more specificity that can be added which wouldn't also apply to Raku (from my limited understanding of both languages). Adding more samples might help, but it might not given how similar Perl is to Raku.
There are two solutions you can implement: