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

changeset 7782
976d3b19ba7f
child 7923
91e843545d9a
equal deleted inserted replaced
7781:607a6098cb44 7782:976d3b19ba7f
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2020 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
49 "A881": QCoreApplication.translate(
50 "AnnotationsChecker",
51 "type annotation coverage of {0}% is too low"),
52
53 "A891": QCoreApplication.translate(
54 "AnnotationsChecker",
55 "type annotation is too complex ({0} > {1})"),
56
57 "A999": QCoreApplication.translate(
58 "AnnotationsChecker",
59 "{0}: {1}"),
60 }
61
62 _annotationsMessagesSampleArgs = {
63 "A001": ["arg1"],
64 "A002": ["args"],
65 "A003": ["kwargs"],
66 "A881": [60],
67 "A891": [5, 3],
68 "A999": ["SyntaxError", "Invalid Syntax"],
69 }

eric ide

mercurial