Detect PHP but I don't have any PHP or HTML code #5161
-
My repo is mainly C++ but github detects it as PHP recently. Preliminary StepsPlease confirm you have...
URL of the affected repository:https://github.com/kochol/ariyana Last modified on:1/22/2021 Expected language:C++ Detected language:PHP |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
This analysis is happening because of all the The None of those files are matching any of the heuristics so the analysis is falling through to the classifier which is making a guess based on the content of the samples Linguist has and it's made as best a guess as it can, and picked PHP, for example: $ LINGUIST_DEBUG=1 github-linguist src/gfx/private/transcoder/basisu_transcoder_tables_bc7_m5_alpha.inc
basisu_transcoder_tables_bc7_m5_alpha.inc: 49 lines (49 sloc)
type: Text
mime type: text/plain
Assembly = -20906.329 + -5.592 = -20911.921
C++ = -11378.941 + -3.877 = -11382.819
HTML = -17147.685 + -5.844 = -17153.528
Motorola 68K Assembly = -44299.009 + -5.998 = -44305.007
NASL = -12526.644 + -5.487 = -12532.131
PHP = -9516.069 + -4.845 = -9520.914
POV-Ray SDL = -12481.660 + -5.305 = -12486.964
Pascal = -15231.504 + -5.305 = -15236.808
Pawn = -13178.207 + -5.998 = -13184.205
SQL = -26224.446 + -5.150 = -26229.597
SourcePawn = -10823.038 + -7.096 = -10830.134
language: PHP
$ Looking at the the content, I don't think the classifier or heuristics would ever have detected these files correctly 😄 so you'll need to implement an override to force them to your preferred language or tell Linguist to ignore them entirely. As an aside, once I can, I'll be moving this issue across to Discussions which I enabled today. |
Beta Was this translation helpful? Give feedback.
-
Thank you |
Beta Was this translation helpful? Give feedback.
-
🎉 Moved, and I've marked my response as the answer. |
Beta Was this translation helpful? Give feedback.
-
I noticed today that https://github.com/Baron-von-Riedesel/DOS-debug is misdetected as 14.3 % NASL. There are some |
Beta Was this translation helpful? Give feedback.
This analysis is happening because of all the
.inc
files in https://github.com/kochol/ariyana/tree/master/src/gfx/private/transcoderThe
.inc
extension is a very generic extension associated with multiple languages so it need to be processed by the heuristics at https://github.com/github/linguist/blob/9eb9472be957108fc48b6c9f725f2100c18b7a5e/lib/linguist/heuristics.yml#L235-L247None of those files are matching any of the heuristics so the analysis is falling through to the classifier which is making a guess based on the content of the samples Linguist has and it's made as best a guess as it can, and picked PHP, for example:
$ LINGUIST_DEBUG=1 github-linguist src/gfx/private/transcoder/ba…