mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-06-16 23:00:03 +02:00
fix: use linguist-generated
for language stats (#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. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7685 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
fb77b82742
commit
3e08356e5b
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