Coverage for app/venv/lib/python3.14/site-packages/weblate/checks/management/commands/list_same_checks.py: 0%

9 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-10-07 07:15 +0000

1# Copyright © Michal Čihař <michal@weblate.org> 

2# 

3# SPDX-License-Identifier: GPL-3.0-or-later 

4 

5from django.core.management.base import BaseCommand 

6from django.db.models import Count 

7 

8from weblate.checks.models import Check 

9 

10 

11class Command(BaseCommand): 

12 help = "lists top untranslated failing checks" 

13 

14 def handle(self, *args, **options) -> None: 

15 results = ( 

16 Check.objects.filter(name="same") 

17 .values("unit__source") 

18 .annotate(Count("unit__source")) 

19 .filter(unit__source__count__gt=1) 

20 .order_by("-unit__source__count") 

21 ) 

22 

23 for item in results: 

24 self.stdout.write( 

25 "{:5d} {}".format(item["unit__source__count"], item["unit__source"]) 

26 )