15 |
15 |
16 __all__ = ["getTranslatedMessage"] |
16 __all__ = ["getTranslatedMessage"] |
17 |
17 |
18 _messages = { |
18 _messages = { |
19 "E101": QCoreApplication.translate( |
19 "E101": QCoreApplication.translate( |
20 "pep8", |
20 "pycodestyle", |
21 "indentation contains mixed spaces and tabs"), |
21 "indentation contains mixed spaces and tabs"), |
22 "E111": QCoreApplication.translate( |
22 "E111": QCoreApplication.translate( |
23 "pep8", |
23 "pycodestyle", |
24 "indentation is not a multiple of four"), |
24 "indentation is not a multiple of four"), |
25 "E112": QCoreApplication.translate( |
25 "E112": QCoreApplication.translate( |
26 "pep8", |
26 "pycodestyle", |
27 "expected an indented block"), |
27 "expected an indented block"), |
28 "E113": QCoreApplication.translate( |
28 "E113": QCoreApplication.translate( |
29 "pep8", |
29 "pycodestyle", |
30 "unexpected indentation"), |
30 "unexpected indentation"), |
31 "E114": QCoreApplication.translate( |
31 "E114": QCoreApplication.translate( |
32 "pep8", |
32 "pycodestyle", |
33 "indentation is not a multiple of four (comment)"), |
33 "indentation is not a multiple of four (comment)"), |
34 "E115": QCoreApplication.translate( |
34 "E115": QCoreApplication.translate( |
35 "pep8", |
35 "pycodestyle", |
36 "expected an indented block (comment)"), |
36 "expected an indented block (comment)"), |
37 "E116": QCoreApplication.translate( |
37 "E116": QCoreApplication.translate( |
38 "pep8", |
38 "pycodestyle", |
39 "unexpected indentation (comment)"), |
39 "unexpected indentation (comment)"), |
40 "E121": QCoreApplication.translate( |
40 "E121": QCoreApplication.translate( |
41 "pep8", |
41 "pycodestyle", |
42 "continuation line indentation is not a multiple of four"), |
42 "continuation line indentation is not a multiple of four"), |
43 "E122": QCoreApplication.translate( |
43 "E122": QCoreApplication.translate( |
44 "pep8", |
44 "pycodestyle", |
45 "continuation line missing indentation or outdented"), |
45 "continuation line missing indentation or outdented"), |
46 "E123": QCoreApplication.translate( |
46 "E123": QCoreApplication.translate( |
47 "pep8", |
47 "pycodestyle", |
48 "closing bracket does not match indentation of opening" |
48 "closing bracket does not match indentation of opening" |
49 " bracket's line"), |
49 " bracket's line"), |
50 "E124": QCoreApplication.translate( |
50 "E124": QCoreApplication.translate( |
51 "pep8", |
51 "pycodestyle", |
52 "closing bracket does not match visual indentation"), |
52 "closing bracket does not match visual indentation"), |
53 "E125": QCoreApplication.translate( |
53 "E125": QCoreApplication.translate( |
54 "pep8", |
54 "pycodestyle", |
55 "continuation line with same indent as next logical line"), |
55 "continuation line with same indent as next logical line"), |
56 "E126": QCoreApplication.translate( |
56 "E126": QCoreApplication.translate( |
57 "pep8", |
57 "pycodestyle", |
58 "continuation line over-indented for hanging indent"), |
58 "continuation line over-indented for hanging indent"), |
59 "E127": QCoreApplication.translate( |
59 "E127": QCoreApplication.translate( |
60 "pep8", |
60 "pycodestyle", |
61 "continuation line over-indented for visual indent"), |
61 "continuation line over-indented for visual indent"), |
62 "E128": QCoreApplication.translate( |
62 "E128": QCoreApplication.translate( |
63 "pep8", |
63 "pycodestyle", |
64 "continuation line under-indented for visual indent"), |
64 "continuation line under-indented for visual indent"), |
65 "E129": QCoreApplication.translate( |
65 "E129": QCoreApplication.translate( |
66 "pep8", |
66 "pycodestyle", |
67 "visually indented line with same indent as next logical line"), |
67 "visually indented line with same indent as next logical line"), |
68 "E131": QCoreApplication.translate( |
68 "E131": QCoreApplication.translate( |
69 "pep8", |
69 "pycodestyle", |
70 "continuation line unaligned for hanging indent"), |
70 "continuation line unaligned for hanging indent"), |
71 "E133": QCoreApplication.translate( |
71 "E133": QCoreApplication.translate( |
72 "pep8", |
72 "pycodestyle", |
73 "closing bracket is missing indentation"), |
73 "closing bracket is missing indentation"), |
74 "W191": QCoreApplication.translate( |
74 "W191": QCoreApplication.translate( |
75 "pep8", |
75 "pycodestyle", |
76 "indentation contains tabs"), |
76 "indentation contains tabs"), |
77 "E201": QCoreApplication.translate( |
77 "E201": QCoreApplication.translate( |
78 "pep8", |
78 "pycodestyle", |
79 "whitespace after '{0}'"), |
79 "whitespace after '{0}'"), |
80 "E202": QCoreApplication.translate( |
80 "E202": QCoreApplication.translate( |
81 "pep8", |
81 "pycodestyle", |
82 "whitespace before '{0}'"), |
82 "whitespace before '{0}'"), |
83 "E203": QCoreApplication.translate( |
83 "E203": QCoreApplication.translate( |
84 "pep8", |
84 "pycodestyle", |
85 "whitespace before '{0}'"), |
85 "whitespace before '{0}'"), |
86 "E211": QCoreApplication.translate( |
86 "E211": QCoreApplication.translate( |
87 "pep8", |
87 "pycodestyle", |
88 "whitespace before '{0}'"), |
88 "whitespace before '{0}'"), |
89 "E221": QCoreApplication.translate( |
89 "E221": QCoreApplication.translate( |
90 "pep8", |
90 "pycodestyle", |
91 "multiple spaces before operator"), |
91 "multiple spaces before operator"), |
92 "E222": QCoreApplication.translate( |
92 "E222": QCoreApplication.translate( |
93 "pep8", |
93 "pycodestyle", |
94 "multiple spaces after operator"), |
94 "multiple spaces after operator"), |
95 "E223": QCoreApplication.translate( |
95 "E223": QCoreApplication.translate( |
96 "pep8", |
96 "pycodestyle", |
97 "tab before operator"), |
97 "tab before operator"), |
98 "E224": QCoreApplication.translate( |
98 "E224": QCoreApplication.translate( |
99 "pep8", |
99 "pycodestyle", |
100 "tab after operator"), |
100 "tab after operator"), |
101 "E225": QCoreApplication.translate( |
101 "E225": QCoreApplication.translate( |
102 "pep8", |
102 "pycodestyle", |
103 "missing whitespace around operator"), |
103 "missing whitespace around operator"), |
104 "E226": QCoreApplication.translate( |
104 "E226": QCoreApplication.translate( |
105 "pep8", |
105 "pycodestyle", |
106 "missing whitespace around arithmetic operator"), |
106 "missing whitespace around arithmetic operator"), |
107 "E227": QCoreApplication.translate( |
107 "E227": QCoreApplication.translate( |
108 "pep8", |
108 "pycodestyle", |
109 "missing whitespace around bitwise or shift operator"), |
109 "missing whitespace around bitwise or shift operator"), |
110 "E228": QCoreApplication.translate( |
110 "E228": QCoreApplication.translate( |
111 "pep8", |
111 "pycodestyle", |
112 "missing whitespace around modulo operator"), |
112 "missing whitespace around modulo operator"), |
113 "E231": QCoreApplication.translate( |
113 "E231": QCoreApplication.translate( |
114 "pep8", |
114 "pycodestyle", |
115 "missing whitespace after '{0}'"), |
115 "missing whitespace after '{0}'"), |
116 "E241": QCoreApplication.translate( |
116 "E241": QCoreApplication.translate( |
117 "pep8", |
117 "pycodestyle", |
118 "multiple spaces after '{0}'"), |
118 "multiple spaces after '{0}'"), |
119 "E242": QCoreApplication.translate( |
119 "E242": QCoreApplication.translate( |
120 "pep8", |
120 "pycodestyle", |
121 "tab after '{0}'"), |
121 "tab after '{0}'"), |
122 "E251": QCoreApplication.translate( |
122 "E251": QCoreApplication.translate( |
123 "pep8", |
123 "pycodestyle", |
124 "unexpected spaces around keyword / parameter equals"), |
124 "unexpected spaces around keyword / parameter equals"), |
125 "E261": QCoreApplication.translate( |
125 "E261": QCoreApplication.translate( |
126 "pep8", |
126 "pycodestyle", |
127 "at least two spaces before inline comment"), |
127 "at least two spaces before inline comment"), |
128 "E262": QCoreApplication.translate( |
128 "E262": QCoreApplication.translate( |
129 "pep8", |
129 "pycodestyle", |
130 "inline comment should start with '# '"), |
130 "inline comment should start with '# '"), |
131 "E265": QCoreApplication.translate( |
131 "E265": QCoreApplication.translate( |
132 "pep8", |
132 "pycodestyle", |
133 "block comment should start with '# '"), |
133 "block comment should start with '# '"), |
134 "E266": QCoreApplication.translate( |
134 "E266": QCoreApplication.translate( |
135 "pep8", |
135 "pycodestyle", |
136 "too many leading '#' for block comment"), |
136 "too many leading '#' for block comment"), |
137 "E271": QCoreApplication.translate( |
137 "E271": QCoreApplication.translate( |
138 "pep8", |
138 "pycodestyle", |
139 "multiple spaces after keyword"), |
139 "multiple spaces after keyword"), |
140 "E272": QCoreApplication.translate( |
140 "E272": QCoreApplication.translate( |
141 "pep8", |
141 "pycodestyle", |
142 "multiple spaces before keyword"), |
142 "multiple spaces before keyword"), |
143 "E273": QCoreApplication.translate( |
143 "E273": QCoreApplication.translate( |
144 "pep8", |
144 "pycodestyle", |
145 "tab after keyword"), |
145 "tab after keyword"), |
146 "E274": QCoreApplication.translate( |
146 "E274": QCoreApplication.translate( |
147 "pep8", |
147 "pycodestyle", |
148 "tab before keyword"), |
148 "tab before keyword"), |
149 "E275": QCoreApplication.translate( |
149 "E275": QCoreApplication.translate( |
150 "pep8", |
150 "pycodestyle", |
151 "missing whitespace after keyword"), |
151 "missing whitespace after keyword"), |
152 "W291": QCoreApplication.translate( |
152 "W291": QCoreApplication.translate( |
153 "pep8", |
153 "pycodestyle", |
154 "trailing whitespace"), |
154 "trailing whitespace"), |
155 "W292": QCoreApplication.translate( |
155 "W292": QCoreApplication.translate( |
156 "pep8", |
156 "pycodestyle", |
157 "no newline at end of file"), |
157 "no newline at end of file"), |
158 "W293": QCoreApplication.translate( |
158 "W293": QCoreApplication.translate( |
159 "pep8", |
159 "pycodestyle", |
160 "blank line contains whitespace"), |
160 "blank line contains whitespace"), |
161 "E301": QCoreApplication.translate( |
161 "E301": QCoreApplication.translate( |
162 "pep8", |
162 "pycodestyle", |
163 "expected 1 blank line, found 0"), |
163 "expected 1 blank line, found 0"), |
164 "E302": QCoreApplication.translate( |
164 "E302": QCoreApplication.translate( |
165 "pep8", |
165 "pycodestyle", |
166 "expected 2 blank lines, found {0}"), |
166 "expected 2 blank lines, found {0}"), |
167 "E303": QCoreApplication.translate( |
167 "E303": QCoreApplication.translate( |
168 "pep8", |
168 "pycodestyle", |
169 "too many blank lines ({0})"), |
169 "too many blank lines ({0})"), |
170 "E304": QCoreApplication.translate( |
170 "E304": QCoreApplication.translate( |
171 "pep8", |
171 "pycodestyle", |
172 "blank lines found after function decorator"), |
172 "blank lines found after function decorator"), |
173 "E305": QCoreApplication.translate( |
173 "E305": QCoreApplication.translate( |
174 "pep8", |
174 "pycodestyle", |
175 "expected 2 blank lines after class or function definition," |
175 "expected 2 blank lines after class or function definition," |
176 " found {0}"), |
176 " found {0}"), |
177 "E306": QCoreApplication.translate( |
177 "E306": QCoreApplication.translate( |
178 "pep8", |
178 "pycodestyle", |
179 "expected 1 blank line before a nested definition, found 0"), |
179 "expected 1 blank line before a nested definition, found 0"), |
180 "W391": QCoreApplication.translate( |
180 "W391": QCoreApplication.translate( |
181 "pep8", |
181 "pycodestyle", |
182 "blank line at end of file"), |
182 "blank line at end of file"), |
183 "E401": QCoreApplication.translate( |
183 "E401": QCoreApplication.translate( |
184 "pep8", |
184 "pycodestyle", |
185 "multiple imports on one line"), |
185 "multiple imports on one line"), |
186 "E402": QCoreApplication.translate( |
186 "E402": QCoreApplication.translate( |
187 "pep8", |
187 "pycodestyle", |
188 "module level import not at top of file"), |
188 "module level import not at top of file"), |
189 "E501": QCoreApplication.translate( |
189 "E501": QCoreApplication.translate( |
190 "pep8", |
190 "pycodestyle", |
191 "line too long ({0} > {1} characters)"), |
191 "line too long ({0} > {1} characters)"), |
192 "E502": QCoreApplication.translate( |
192 "E502": QCoreApplication.translate( |
193 "pep8", |
193 "pycodestyle", |
194 "the backslash is redundant between brackets"), |
194 "the backslash is redundant between brackets"), |
195 "W503": QCoreApplication.translate( |
195 "W503": QCoreApplication.translate( |
196 "pep8", |
196 "pycodestyle", |
197 "line break before binary operator"), |
197 "line break before binary operator"), |
198 "W601": QCoreApplication.translate( |
198 "W601": QCoreApplication.translate( |
199 "pep8", |
199 "pycodestyle", |
200 ".has_key() is deprecated, use 'in'"), |
200 ".has_key() is deprecated, use 'in'"), |
201 "W602": QCoreApplication.translate( |
201 "W602": QCoreApplication.translate( |
202 "pep8", |
202 "pycodestyle", |
203 "deprecated form of raising exception"), |
203 "deprecated form of raising exception"), |
204 "W603": QCoreApplication.translate( |
204 "W603": QCoreApplication.translate( |
205 "pep8", |
205 "pycodestyle", |
206 "'<>' is deprecated, use '!='"), |
206 "'<>' is deprecated, use '!='"), |
207 "W604": QCoreApplication.translate( |
207 "W604": QCoreApplication.translate( |
208 "pep8", |
208 "pycodestyle", |
209 "backticks are deprecated, use 'repr()'"), |
209 "backticks are deprecated, use 'repr()'"), |
210 "E701": QCoreApplication.translate( |
210 "E701": QCoreApplication.translate( |
211 "pep8", |
211 "pycodestyle", |
212 "multiple statements on one line (colon)"), |
212 "multiple statements on one line (colon)"), |
213 "E702": QCoreApplication.translate( |
213 "E702": QCoreApplication.translate( |
214 "pep8", |
214 "pycodestyle", |
215 "multiple statements on one line (semicolon)"), |
215 "multiple statements on one line (semicolon)"), |
216 "E703": QCoreApplication.translate( |
216 "E703": QCoreApplication.translate( |
217 "pep8", |
217 "pycodestyle", |
218 "statement ends with a semicolon"), |
218 "statement ends with a semicolon"), |
219 "E704": QCoreApplication.translate( |
219 "E704": QCoreApplication.translate( |
220 "pep8", |
220 "pycodestyle", |
221 "multiple statements on one line (def)"), |
221 "multiple statements on one line (def)"), |
222 "E705": QCoreApplication.translate( |
222 "E705": QCoreApplication.translate( |
223 "pep8", |
223 "pycodestyle", |
224 "multiple statements on one line (async def)"), |
224 "multiple statements on one line (async def)"), |
225 "E711": QCoreApplication.translate( |
225 "E711": QCoreApplication.translate( |
226 "pep8", |
226 "pycodestyle", |
227 "comparison to {0} should be {1}"), |
227 "comparison to {0} should be {1}"), |
228 "E712": QCoreApplication.translate( |
228 "E712": QCoreApplication.translate( |
229 "pep8", |
229 "pycodestyle", |
230 "comparison to {0} should be {1}"), |
230 "comparison to {0} should be {1}"), |
231 "E713": QCoreApplication.translate( |
231 "E713": QCoreApplication.translate( |
232 "pep8", |
232 "pycodestyle", |
233 "test for membership should be 'not in'"), |
233 "test for membership should be 'not in'"), |
234 "E714": QCoreApplication.translate( |
234 "E714": QCoreApplication.translate( |
235 "pep8", |
235 "pycodestyle", |
236 "test for object identity should be 'is not'"), |
236 "test for object identity should be 'is not'"), |
237 "E721": QCoreApplication.translate( |
237 "E721": QCoreApplication.translate( |
238 "pep8", |
238 "pycodestyle", |
239 "do not compare types, use 'isinstance()'"), |
239 "do not compare types, use 'isinstance()'"), |
240 "E731": QCoreApplication.translate( |
240 "E731": QCoreApplication.translate( |
241 "pep8", |
241 "pycodestyle", |
242 "do not assign a lambda expression, use a def"), |
242 "do not assign a lambda expression, use a def"), |
243 "E741": QCoreApplication.translate( |
243 "E741": QCoreApplication.translate( |
244 "pep8", |
244 "pycodestyle", |
245 "ambiguous variable name '{0}'"), |
245 "ambiguous variable name '{0}'"), |
246 "E742": QCoreApplication.translate( |
246 "E742": QCoreApplication.translate( |
247 "pep8", |
247 "pycodestyle", |
248 "ambiguous class definition '{0}'"), |
248 "ambiguous class definition '{0}'"), |
249 "E743": QCoreApplication.translate( |
249 "E743": QCoreApplication.translate( |
250 "pep8", |
250 "pycodestyle", |
251 "ambiguous function definition '{0}'"), |
251 "ambiguous function definition '{0}'"), |
252 "E901": QCoreApplication.translate( |
252 "E901": QCoreApplication.translate( |
253 "pep8", |
253 "pycodestyle", |
254 "{0}: {1}"), |
254 "{0}: {1}"), |
255 "E902": QCoreApplication.translate( |
255 "E902": QCoreApplication.translate( |
256 "pep8", |
256 "pycodestyle", |
257 "{0}"), |
257 "{0}"), |
258 |
258 |
259 # DocStyleChecker messages |
259 # DocStyleChecker messages |
260 "D101": QCoreApplication.translate( |
260 "D101": QCoreApplication.translate( |
261 "DocStyleChecker", "module is missing a docstring"), |
261 "DocStyleChecker", "module is missing a docstring"), |