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

Mon, 24 Feb 2025 15:11:18 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 24 Feb 2025 15:11:18 +0100
branch
eric7
changeset 11147
dee6e106b4d3
parent 11090
f5f5f5803935
permissions
-rw-r--r--

Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).

7782
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
11090
f5f5f5803935 Updated copyright for 2025.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10439
diff changeset
3 # Copyright (c) 2020 - 2025 Detlev Offenbach <detlev@die-offenbachs.de>
7782
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 """
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 Module implementing message translations for the code style plugin messages
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 (code annotations part).
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 """
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
12 from PyQt6.QtCore import QCoreApplication
7782
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 _annotationsMessages = {
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
15 "A-001": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
16 "AnnotationsChecker", "missing type annotation for function argument '{0}'"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
17 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
18 "A-002": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
19 "AnnotationsChecker", "missing type annotation for '*{0}'"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
20 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
21 "A-003": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
22 "AnnotationsChecker", "missing type annotation for '**{0}'"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
23 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
24 "A-101": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
25 "AnnotationsChecker", "missing type annotation for 'self' in method"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
26 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
27 "A-102": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
28 "AnnotationsChecker", "missing type annotation for 'cls' in classmethod"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
29 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
30 "A-201": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
31 "AnnotationsChecker", "missing return type annotation for public function"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
32 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
33 "A-202": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
34 "AnnotationsChecker", "missing return type annotation for protected function"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
35 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
36 "A-203": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
37 "AnnotationsChecker", "missing return type annotation for private function"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
38 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
39 "A-204": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
40 "AnnotationsChecker", "missing return type annotation for special method"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
41 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
42 "A-205": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
43 "AnnotationsChecker", "missing return type annotation for staticmethod"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
44 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
45 "A-206": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
46 "AnnotationsChecker", "missing return type annotation for classmethod"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
47 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
48 "A-401": QCoreApplication.translate(
9276
e6748a5e24b9 Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
49 "AnnotationsChecker",
e6748a5e24b9 Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
50 "Dynamically typed expressions (typing.Any) are disallowed",
e6748a5e24b9 Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
51 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
52 "A-402": QCoreApplication.translate(
10058
5d965939ab85 Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10046
diff changeset
53 "AnnotationsChecker", "Type comments are disallowed"
5d965939ab85 Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10046
diff changeset
54 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
55 "A-871": QCoreApplication.translate(
8773
3dd81b827455 Extended the annotations checker to check for missing 'from __future__ import annotations'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
56 "AnnotationsChecker",
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
57 "missing 'from __future__ import annotations' but imports: {0}",
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
58 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
59 "A-872": QCoreApplication.translate(
9276
e6748a5e24b9 Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
60 "AnnotationsChecker", "missing 'from __future__ import annotations'"
e6748a5e24b9 Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9221
diff changeset
61 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
62 "A-873": QCoreApplication.translate(
10046
35b27af462ef Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10043
diff changeset
63 "AnnotationsChecker",
35b27af462ef Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10043
diff changeset
64 "missing 'from __future__ import annotations' but uses simplified type"
35b27af462ef Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10043
diff changeset
65 " annotations: {0}",
10043
f1427d95cfde Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9653
diff changeset
66 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
67 "A-881": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
68 "AnnotationsChecker", "type annotation coverage of {0}% is too low"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
69 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
70 "A-891": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
71 "AnnotationsChecker", "type annotation is too complex ({0} > {1})"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
72 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
73 "A-892": QCoreApplication.translate(
9221
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
74 "AnnotationsChecker", "type annotation is too long ({0} > {1})"
bf71ee032bb4 Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 9209
diff changeset
75 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
76 "A-901": QCoreApplication.translate(
10087
65b7354b0d4c Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10086
diff changeset
77 "AnnotationsChecker",
65b7354b0d4c Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10086
diff changeset
78 "'typing.Union' is deprecated, use '|' instead (see PEP 604)",
65b7354b0d4c Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10086
diff changeset
79 ),
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
80 "A-911": QCoreApplication.translate(
10087
65b7354b0d4c Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10086
diff changeset
81 "AnnotationsChecker",
65b7354b0d4c Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10086
diff changeset
82 "'typing.{0}' is deprecated, use '{1}' instead (see PEP 585)",
10086
c8854a6300d1 Code Style Checker
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 10058
diff changeset
83 ),
7782
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 }
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 _annotationsMessagesSampleArgs = {
11147
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
87 "A-001": ["arg1"],
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
88 "A-002": ["args"],
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
89 "A-003": ["kwargs"],
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
90 "A-871": ["Dict, List"],
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
91 "A-873": ["dict, list"],
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
92 "A-881": [60],
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
93 "A-891": [5, 3],
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
94 "A-892": [10, 7],
dee6e106b4d3 Modified the code style checker such, that the issue category and issue number are separated by a '-' to make up the issue code (e.g E-901).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 11090
diff changeset
95 "A-911": ["List", "list"],
7782
976d3b19ba7f Started refactoring the code style checker.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 }

eric ide

mercurial