eric7/Plugins/CheckerPlugins/CodeStyleChecker/Annotations/translations.py

branch
eric7
changeset 8312
800c432b34c8
parent 8244
ed8cb108b27b
child 8318
962bce857696
equal deleted inserted replaced
8311:4e8b98454baa 8312:800c432b34c8
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2020 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6
7 """
8 Module implementing message translations for the code style plugin messages
9 (code annotations part).
10 """
11
12 from PyQt5.QtCore import QCoreApplication
13
14 _annotationsMessages = {
15 "A001": QCoreApplication.translate(
16 "AnnotationsChecker",
17 "missing type annotation for function argument '{0}'"),
18 "A002": QCoreApplication.translate(
19 "AnnotationsChecker",
20 "missing type annotation for '*{0}'"),
21 "A003": QCoreApplication.translate(
22 "AnnotationsChecker",
23 "missing type annotation for '**{0}'"),
24 "A101": QCoreApplication.translate(
25 "AnnotationsChecker",
26 "missing type annotation for 'self' in method"),
27 "A102": QCoreApplication.translate(
28 "AnnotationsChecker",
29 "missing type annotation for 'cls' in classmethod"),
30 "A201": QCoreApplication.translate(
31 "AnnotationsChecker",
32 "missing return type annotation for public function"),
33 "A202": QCoreApplication.translate(
34 "AnnotationsChecker",
35 "missing return type annotation for protected function"),
36 "A203": QCoreApplication.translate(
37 "AnnotationsChecker",
38 "missing return type annotation for private function"),
39 "A204": QCoreApplication.translate(
40 "AnnotationsChecker",
41 "missing return type annotation for special method"),
42 "A205": QCoreApplication.translate(
43 "AnnotationsChecker",
44 "missing return type annotation for staticmethod"),
45 "A206": QCoreApplication.translate(
46 "AnnotationsChecker",
47 "missing return type annotation for classmethod"),
48 "A301": QCoreApplication.translate(
49 "AnnotationsChecker",
50 "PEP 484 disallows both type annotations and type comments"),
51
52 "A881": QCoreApplication.translate(
53 "AnnotationsChecker",
54 "type annotation coverage of {0}% is too low"),
55
56 "A891": QCoreApplication.translate(
57 "AnnotationsChecker",
58 "type annotation is too complex ({0} > {1})"),
59 "A892": QCoreApplication.translate(
60 "AnnotationsChecker",
61 "type annotation is too long ({0} > {1})"),
62 }
63
64 _annotationsMessagesSampleArgs = {
65 "A001": ["arg1"],
66 "A002": ["args"],
67 "A003": ["kwargs"],
68 "A881": [60],
69 "A891": [5, 3],
70 "A892": [10, 7],
71 }

eric ide

mercurial