Language Recognition Issue #6494
-
Hello everyone, I hope you're doing well. I'm currently facing an issue with language recognition for a specific file in my GitHub repository, and I thought it would be best to open a discussion to address it. Repository: (https://github.com/Makuaa/Postman-API-Test) I have added a .gitattributes file to specify the language for the Mypetstore.postman_collection.json file within my repository. The content of my .gitattributes file is as follows: Mypetstore.postman_collection.json linguist-language=JSON Despite setting the language as JSON, the file is not being recognized correctly by Linguist, and it is not showing up as a JSON file in the repository. I would like to request your assistance in resolving this issue. I believe that clearing the Linguist cache for my repository could potentially fix the problem. Could someone please guide me on how to proceed with clearing the cache or suggest any alternative solutions? Thank you all for your time and support. I look forward to resolving this matter and improving the language recognition for my repository. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
The file is being correctly identified as JSON (without the override) as you're getting correct syntax highlighting. The reason you're not seeing the language in the sidebar is because JSON is considered If you want it to be considered in the stats and show in the sidebar you need to use the detectable override. |
Beta Was this translation helpful? Give feedback.
-
Hello dear git community, Thanks in advance for your attention, I am also having problems with language recognition Supposedly, I should have a much higher percentage of C language, but for some reason it's not being recognized, can you guys help me? Thank you all for your time and support. |
Beta Was this translation helpful? Give feedback.
The file is being correctly identified as JSON (without the override) as you're getting correct syntax highlighting. The reason you're not seeing the language in the sidebar is because JSON is considered
data
so is excluded by default (see How Linguist Works).If you want it to be considered in the stats and show in the sidebar you need to use the detectable override.