peng-zhihui / ElectronBot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

添加.gitattributes文件

Mehver opened this issue · comments

Discussed in #206

Originally posted by TitanRGB July 24, 2022
image

效果类似上图,就是能让GitHub的语言统计识别到这些EDA软件。我整理了一个万能的.gitattributes,可以使GitHub正确的识别Altium Designer、KiCAD、Gerber以及Eagle。我把这个文件放在了我的Gist里https://gist.github.com/TitanRGB/61c37bf71159cc9a511558ec7c218339

其中,能使AD语言生效的部分是:

*.OutJob linguist-detectable=true
*.PcbDoc linguist-detectable=true
*.PrjPCB linguist-detectable=true
*.SchDoc linguist-detectable=true
*.outjob linguist-detectable=true
*.pcbdoc linguist-detectable=true
*.prjpcb linguist-detectable=true
*.schdoc linguist-detectable=true

直接把这几行放到.gitattributes里就行。

其原理可见https://github.com/github/linguist,这就是GitHub语言统计功能的repo。

让GitHub统计这些EDA为语言除了满足强迫症,更重要的是很多人检索项目时,通过显示的“主要语言”能更方便的区分软件项目和硬件项目。很多时候我想找硬件设计的项目,但是看到语言是C或者C++,点进去才知道是固件之类的;如果看到语言是某个EDA,就能更快的检索到想找的项目。此外,通过“指定语言搜索”会更加方便!