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

branch
eric7
changeset 11147
dee6e106b4d3
parent 11090
f5f5f5803935
equal deleted inserted replaced
11146:59e04f7003e9 11147:dee6e106b4d3
10 """ 10 """
11 11
12 from PyQt6.QtCore import QCoreApplication 12 from PyQt6.QtCore import QCoreApplication
13 13
14 _docStyleMessages = { 14 _docStyleMessages = {
15 "D101": QCoreApplication.translate( 15 "D-101": QCoreApplication.translate(
16 "DocStyleChecker", "module is missing a docstring" 16 "DocStyleChecker", "module is missing a docstring"
17 ), 17 ),
18 "D102": QCoreApplication.translate( 18 "D-102": QCoreApplication.translate(
19 "DocStyleChecker", "public function/method is missing a docstring" 19 "DocStyleChecker", "public function/method is missing a docstring"
20 ), 20 ),
21 "D103": QCoreApplication.translate( 21 "D-103": QCoreApplication.translate(
22 "DocStyleChecker", "private function/method may be missing a docstring" 22 "DocStyleChecker", "private function/method may be missing a docstring"
23 ), 23 ),
24 "D104": QCoreApplication.translate( 24 "D-104": QCoreApplication.translate(
25 "DocStyleChecker", "public class is missing a docstring" 25 "DocStyleChecker", "public class is missing a docstring"
26 ), 26 ),
27 "D105": QCoreApplication.translate( 27 "D-105": QCoreApplication.translate(
28 "DocStyleChecker", "private class may be missing a docstring" 28 "DocStyleChecker", "private class may be missing a docstring"
29 ), 29 ),
30 "D111": QCoreApplication.translate( 30 "D-111": QCoreApplication.translate(
31 "DocStyleChecker", 'docstring not surrounded by """' 31 "DocStyleChecker", 'docstring not surrounded by """'
32 ), 32 ),
33 "D112": QCoreApplication.translate( 33 "D-112": QCoreApplication.translate(
34 "DocStyleChecker", 'docstring containing \\ not surrounded by r"""' 34 "DocStyleChecker", 'docstring containing \\ not surrounded by r"""'
35 ), 35 ),
36 "D121": QCoreApplication.translate( 36 "D-121": QCoreApplication.translate(
37 "DocStyleChecker", "one-liner docstring on multiple lines" 37 "DocStyleChecker", "one-liner docstring on multiple lines"
38 ), 38 ),
39 "D122": QCoreApplication.translate( 39 "D-122": QCoreApplication.translate(
40 "DocStyleChecker", "docstring has wrong indentation" 40 "DocStyleChecker", "docstring has wrong indentation"
41 ), 41 ),
42 "D130": QCoreApplication.translate( 42 "D-130": QCoreApplication.translate(
43 "DocStyleChecker", "docstring does not contain a summary" 43 "DocStyleChecker", "docstring does not contain a summary"
44 ), 44 ),
45 "D131": QCoreApplication.translate( 45 "D-131": QCoreApplication.translate(
46 "DocStyleChecker", "docstring summary does not end with a period" 46 "DocStyleChecker", "docstring summary does not end with a period"
47 ), 47 ),
48 "D132": QCoreApplication.translate( 48 "D-132": QCoreApplication.translate(
49 "DocStyleChecker", 49 "DocStyleChecker",
50 "docstring summary is not in imperative mood (Does instead of Do)", 50 "docstring summary is not in imperative mood (Does instead of Do)",
51 ), 51 ),
52 "D133": QCoreApplication.translate( 52 "D-133": QCoreApplication.translate(
53 "DocStyleChecker", 53 "DocStyleChecker",
54 "docstring summary looks like a function's/method's signature", 54 "docstring summary looks like a function's/method's signature",
55 ), 55 ),
56 "D134": QCoreApplication.translate( 56 "D-134": QCoreApplication.translate(
57 "DocStyleChecker", "docstring does not mention the return value type" 57 "DocStyleChecker", "docstring does not mention the return value type"
58 ), 58 ),
59 "D141": QCoreApplication.translate( 59 "D-141": QCoreApplication.translate(
60 "DocStyleChecker", "function/method docstring is separated by a blank line" 60 "DocStyleChecker", "function/method docstring is separated by a blank line"
61 ), 61 ),
62 "D142": QCoreApplication.translate( 62 "D-142": QCoreApplication.translate(
63 "DocStyleChecker", "class docstring is not preceded by a blank line" 63 "DocStyleChecker", "class docstring is not preceded by a blank line"
64 ), 64 ),
65 "D143": QCoreApplication.translate( 65 "D-143": QCoreApplication.translate(
66 "DocStyleChecker", "class docstring is not followed by a blank line" 66 "DocStyleChecker", "class docstring is not followed by a blank line"
67 ), 67 ),
68 "D144": QCoreApplication.translate( 68 "D-144": QCoreApplication.translate(
69 "DocStyleChecker", "docstring summary is not followed by a blank line" 69 "DocStyleChecker", "docstring summary is not followed by a blank line"
70 ), 70 ),
71 "D145": QCoreApplication.translate( 71 "D-145": QCoreApplication.translate(
72 "DocStyleChecker", "last paragraph of docstring is not followed by a blank line" 72 "DocStyleChecker", "last paragraph of docstring is not followed by a blank line"
73 ), 73 ),
74 "D201": QCoreApplication.translate( 74 "D-201": QCoreApplication.translate(
75 "DocStyleChecker", "module docstring is still a default string" 75 "DocStyleChecker", "module docstring is still a default string"
76 ), 76 ),
77 "D202.1": QCoreApplication.translate( 77 "D-202.1": QCoreApplication.translate(
78 "DocStyleChecker", "function docstring is still a default string" 78 "DocStyleChecker", "function docstring is still a default string"
79 ), 79 ),
80 "D202.2": QCoreApplication.translate( 80 "D-202.2": QCoreApplication.translate(
81 "DocStyleChecker", "function docstring still contains some placeholders" 81 "DocStyleChecker", "function docstring still contains some placeholders"
82 ), 82 ),
83 "D203": QCoreApplication.translate( 83 "D-203": QCoreApplication.translate(
84 "DocStyleChecker", "private function/method is missing a docstring" 84 "DocStyleChecker", "private function/method is missing a docstring"
85 ), 85 ),
86 "D205": QCoreApplication.translate( 86 "D-205": QCoreApplication.translate(
87 "DocStyleChecker", "private class is missing a docstring" 87 "DocStyleChecker", "private class is missing a docstring"
88 ), 88 ),
89 "D206": QCoreApplication.translate( 89 "D-206": QCoreApplication.translate(
90 "DocStyleChecker", "class docstring is still a default string" 90 "DocStyleChecker", "class docstring is still a default string"
91 ), 91 ),
92 "D221": QCoreApplication.translate( 92 "D-221": QCoreApplication.translate(
93 "DocStyleChecker", "leading quotes of docstring not on separate line" 93 "DocStyleChecker", "leading quotes of docstring not on separate line"
94 ), 94 ),
95 "D222": QCoreApplication.translate( 95 "D-222": QCoreApplication.translate(
96 "DocStyleChecker", "trailing quotes of docstring not on separate line" 96 "DocStyleChecker", "trailing quotes of docstring not on separate line"
97 ), 97 ),
98 "D231": QCoreApplication.translate( 98 "D-231": QCoreApplication.translate(
99 "DocStyleChecker", "docstring summary does not end with a period" 99 "DocStyleChecker", "docstring summary does not end with a period"
100 ), 100 ),
101 "D232": QCoreApplication.translate( 101 "D-232": QCoreApplication.translate(
102 "DocStyleChecker", "docstring summary does not start with '{0}'" 102 "DocStyleChecker", "docstring summary does not start with '{0}'"
103 ), 103 ),
104 "D234r": QCoreApplication.translate( 104 "D-234r": QCoreApplication.translate(
105 "DocStyleChecker", 105 "DocStyleChecker",
106 "docstring does not contain a @return line but function/method" 106 "docstring does not contain a @return line but function/method"
107 " returns something", 107 " returns something",
108 ), 108 ),
109 "D235r": QCoreApplication.translate( 109 "D-235r": QCoreApplication.translate(
110 "DocStyleChecker", 110 "DocStyleChecker",
111 "docstring contains a @return line but function/method doesn't" 111 "docstring contains a @return line but function/method doesn't"
112 " return anything", 112 " return anything",
113 ), 113 ),
114 "D234y": QCoreApplication.translate( 114 "D-234y": QCoreApplication.translate(
115 "DocStyleChecker", 115 "DocStyleChecker",
116 "docstring does not contain a @yield line but function/method" 116 "docstring does not contain a @yield line but function/method"
117 " yields something", 117 " yields something",
118 ), 118 ),
119 "D235y": QCoreApplication.translate( 119 "D-235y": QCoreApplication.translate(
120 "DocStyleChecker", 120 "DocStyleChecker",
121 "docstring contains a @yield line but function/method doesn't" 121 "docstring contains a @yield line but function/method doesn't"
122 " yield anything", 122 " yield anything",
123 ), 123 ),
124 "D236": QCoreApplication.translate( 124 "D-236": QCoreApplication.translate(
125 "DocStyleChecker", "docstring does not contain enough @param/@keyparam lines" 125 "DocStyleChecker", "docstring does not contain enough @param/@keyparam lines"
126 ), 126 ),
127 "D237": QCoreApplication.translate( 127 "D-237": QCoreApplication.translate(
128 "DocStyleChecker", "docstring contains too many @param/@keyparam lines" 128 "DocStyleChecker", "docstring contains too many @param/@keyparam lines"
129 ), 129 ),
130 "D238": QCoreApplication.translate( 130 "D-238": QCoreApplication.translate(
131 "DocStyleChecker", 131 "DocStyleChecker",
132 "keyword only arguments must be documented with @keyparam lines", 132 "keyword only arguments must be documented with @keyparam lines",
133 ), 133 ),
134 "D239": QCoreApplication.translate( 134 "D-239": QCoreApplication.translate(
135 "DocStyleChecker", 135 "DocStyleChecker",
136 "order of @param/@keyparam lines does" 136 "order of @param/@keyparam lines does"
137 " not match the function/method signature", 137 " not match the function/method signature",
138 ), 138 ),
139 "D242": QCoreApplication.translate( 139 "D-242": QCoreApplication.translate(
140 "DocStyleChecker", "class docstring is preceded by a blank line" 140 "DocStyleChecker", "class docstring is preceded by a blank line"
141 ), 141 ),
142 "D243": QCoreApplication.translate( 142 "D-243": QCoreApplication.translate(
143 "DocStyleChecker", "class docstring is followed by a blank line" 143 "DocStyleChecker", "class docstring is followed by a blank line"
144 ), 144 ),
145 "D244": QCoreApplication.translate( 145 "D-244": QCoreApplication.translate(
146 "DocStyleChecker", "function/method docstring is preceded by a blank line" 146 "DocStyleChecker", "function/method docstring is preceded by a blank line"
147 ), 147 ),
148 "D245": QCoreApplication.translate( 148 "D-245": QCoreApplication.translate(
149 "DocStyleChecker", "function/method docstring is followed by a blank line" 149 "DocStyleChecker", "function/method docstring is followed by a blank line"
150 ), 150 ),
151 "D246": QCoreApplication.translate( 151 "D-246": QCoreApplication.translate(
152 "DocStyleChecker", "docstring summary is not followed by a blank line" 152 "DocStyleChecker", "docstring summary is not followed by a blank line"
153 ), 153 ),
154 "D247": QCoreApplication.translate( 154 "D-247": QCoreApplication.translate(
155 "DocStyleChecker", "last paragraph of docstring is followed by a blank line" 155 "DocStyleChecker", "last paragraph of docstring is followed by a blank line"
156 ), 156 ),
157 "D250": QCoreApplication.translate( 157 "D-250": QCoreApplication.translate(
158 "DocStyleChecker", 158 "DocStyleChecker",
159 "docstring does not contain a @exception line but function/method" 159 "docstring does not contain a @exception line but function/method"
160 " raises an exception", 160 " raises an exception",
161 ), 161 ),
162 "D251": QCoreApplication.translate( 162 "D-251": QCoreApplication.translate(
163 "DocStyleChecker", 163 "DocStyleChecker",
164 "docstring contains a @exception line but function/method doesn't" 164 "docstring contains a @exception line but function/method doesn't"
165 " raise an exception", 165 " raise an exception",
166 ), 166 ),
167 "D252": QCoreApplication.translate( 167 "D-252": QCoreApplication.translate(
168 "DocStyleChecker", "raised exception '{0}' is not documented in docstring" 168 "DocStyleChecker", "raised exception '{0}' is not documented in docstring"
169 ), 169 ),
170 "D253": QCoreApplication.translate( 170 "D-253": QCoreApplication.translate(
171 "DocStyleChecker", "documented exception '{0}' is not raised" 171 "DocStyleChecker", "documented exception '{0}' is not raised"
172 ), 172 ),
173 "D260": QCoreApplication.translate( 173 "D-260": QCoreApplication.translate(
174 "DocStyleChecker", 174 "DocStyleChecker",
175 "docstring does not contain a @signal line but class defines signals", 175 "docstring does not contain a @signal line but class defines signals",
176 ), 176 ),
177 "D261": QCoreApplication.translate( 177 "D-261": QCoreApplication.translate(
178 "DocStyleChecker", 178 "DocStyleChecker",
179 "docstring contains a @signal line but class doesn't define signals", 179 "docstring contains a @signal line but class doesn't define signals",
180 ), 180 ),
181 "D262": QCoreApplication.translate( 181 "D-262": QCoreApplication.translate(
182 "DocStyleChecker", "defined signal '{0}' is not documented in docstring" 182 "DocStyleChecker", "defined signal '{0}' is not documented in docstring"
183 ), 183 ),
184 "D263": QCoreApplication.translate( 184 "D-263": QCoreApplication.translate(
185 "DocStyleChecker", "documented signal '{0}' is not defined" 185 "DocStyleChecker", "documented signal '{0}' is not defined"
186 ), 186 ),
187 "D270": QCoreApplication.translate( 187 "D-270": QCoreApplication.translate(
188 "DocStyleChecker", "'{0}' line should be followed by an '{1}' line" 188 "DocStyleChecker", "'{0}' line should be followed by an '{1}' line"
189 ), 189 ),
190 "D271": QCoreApplication.translate( 190 "D-271": QCoreApplication.translate(
191 "DocStyleChecker", "'{0}' line should not be preceded by an empty line" 191 "DocStyleChecker", "'{0}' line should not be preceded by an empty line"
192 ), 192 ),
193 "D272": QCoreApplication.translate( 193 "D-272": QCoreApplication.translate(
194 "DocStyleChecker", "don't use '{0}' but '{1}' instead" 194 "DocStyleChecker", "don't use '{0}' but '{1}' instead"
195 ), 195 ),
196 "D273": QCoreApplication.translate( 196 "D-273": QCoreApplication.translate(
197 "DocStyleChecker", "'{0}' line has wrong indentation" 197 "DocStyleChecker", "'{0}' line has wrong indentation"
198 ), 198 ),
199 } 199 }
200 200
201 _docStyleMessagesSampleArgs = { 201 _docStyleMessagesSampleArgs = {
202 "D232": ["public"], 202 "D-232": ["public"],
203 "D252": ["RuntimeError"], 203 "D-252": ["RuntimeError"],
204 "D253": ["RuntimeError"], 204 "D-253": ["RuntimeError"],
205 "D262": ["buttonClicked"], 205 "D-262": ["buttonClicked"],
206 "D263": ["buttonClicked"], 206 "D-263": ["buttonClicked"],
207 "D270": ["@param", "@type"], 207 "D-270": ["@param", "@type"],
208 "D271": ["@type"], 208 "D-271": ["@type"],
209 "D272": ["@ptype", "@type"], 209 "D-272": ["@ptype", "@type"],
210 "D273": ["@type"], 210 "D-273": ["@type"],
211 } 211 }

eric ide

mercurial