mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-02 00:15:21 +02:00
[v11.0/forgejo] fix: use linguist-generated
for language stats (#7694)
**Backport:** https://codeberg.org/forgejo/forgejo/pulls/7685 - Adds code comment to explain behavior of the `linguist-generated` gitattribute. - Adjusts the code to ignore the file if `linguist-generated` is true. - Resolves forgejo/forgejo#7677 - Adds unit testing. <!--start release-notes-assistant--> ## Release notes <!--URL:https://codeberg.org/forgejo/forgejo--> - Bug fixes - [PR](https://codeberg.org/forgejo/forgejo/pulls/7694): <!--number 7694 --><!--line 0 --><!--description Zml4OiB1c2UgYGxpbmd1aXN0LWdlbmVyYXRlZGAgZm9yIGxhbmd1YWdlIHN0YXRz-->fix: use `linguist-generated` for language stats<!--description--> <!--end release-notes-assistant--> Co-authored-by: Gusted <postmaster@gusted.xyz> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7694 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org> Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
parent
bc6c0b610b
commit
e837350319
23 changed files with 18 additions and 6 deletions
|
@ -25,6 +25,15 @@ func TestRepository_GetLanguageStats(t *testing.T) {
|
|||
"Python": 134,
|
||||
"Java": 112,
|
||||
}, stats)
|
||||
|
||||
stats, err = gitRepo.GetLanguageStats("95d3505f2db273e40be79f84416051ae85e9ea0d")
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, map[string]int64{
|
||||
"Cobra": 67,
|
||||
"Python": 67,
|
||||
"Java": 112,
|
||||
}, stats)
|
||||
}
|
||||
|
||||
func TestMergeLanguageStats(t *testing.T) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue