-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: New shortpost - gitattributes-linguist
- Loading branch information
1 parent
6c141e5
commit a9767d6
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
titleTC: '在 .gitattributes 設置 Linguist 改變專案語言統計' | ||
publishDate: 2024-06-26 | ||
category: 'GitHub' | ||
social: | ||
threads: 'https://www.threads.net/@webdong.dev/post/C8W-bQYBOav' | ||
--- | ||
|
||
[Linguist](https://github.com/github-linguist/linguist) 用於統計 GitHub 倉庫中的語言比例。 | ||
|
||
像是 [TypeScript 專案](https://github.com/microsoft/TypeScript/blob/main/.gitattributes)就特意將所有 `.js` 檔案統計替換成 TypeScript,才會出現整個專案由 `99.9%` TypeScript 構成的統計結果。 | ||
|
||
![TypeScript 語言統計](./typescript-language.webp) | ||
|
||
```bash | ||
*.js linguist-language=TypeScript | ||
``` | ||
|
||
其他用途像是排除特定的檔案或目錄於統計中,可以幫助我們把不重要的資訊排除,讓真正的專案語言統計更加準確(在 GitHub 倉庫顯示上)。 | ||
|
||
```bash | ||
# 排除特定檔案 | ||
*.md linguist-vendored | ||
|
||
# 排除特定目錄 | ||
docs/* linguist-vendored | ||
``` |
3 changes: 3 additions & 0 deletions
3
src/content/shortPost/gitattributes-linguist/typescript-language.webp
Git LFS file not shown