Debian Codegraph @

doc/whatsnew/2/2.4/full.rst

raw
1 Full changelog
2 ==============
3
4 What's New in Pylint 2.4.4?
5 ---------------------------
6 Release date: 2019-11-13
7
8 * Exempt all the names found in type annotations from ``unused-import``
9
10 The previous code was assuming that only ``typing`` names need to be
11 exempted, but we need to do that for the rest of the type comment
12 names as well.
13
14 Closes #3112
15
16 * Relax type import detection for names that do not come from the ``typing`` module
17
18 Closes #3191
19
20
21 What's New in Pylint 2.4.3?
22 ---------------------------
23 Release date: 2019-10-18
24
25 * Fix an issue with ``unnecessary-comprehension`` in comprehensions with additional repacking of elements.
26
27 Closes #3148
28
29 * ``import-outside-toplevel`` is emitted for ``ImportFrom`` nodes as well.
30
31 Closes #3175
32
33 * Do not emit ``no-method-argument`` for functions using positional only args.
34
35 Closes #3161
36
37 * ``consider-using-sys-exit`` is no longer emitted when ``exit`` is imported in the local scope.
38
39 Closes #3147
40
41 * ``invalid-overridden-method`` takes ``abc.abstractproperty`` in account
42
43 Closes #3150
44
45 * Fixed ``missing-yield-type-doc`` getting incorrectly raised when
46 a generator does not document a yield type but has a type annotation.
47
48 Closes #3185
49
50 * ``typing.overload`` functions are exempted from ``too-many-function-args``
51
52 Closes #3170
53
54
55 What's New in Pylint 2.4.2?
56 ---------------------------
57 Release date: 2019-09-30
58
59
60 * ``ignored-modules`` can skip submodules.
61
62 Closes #3135
63
64 * ``self-assigning-variable`` skips class level assignments.
65
66 Closes #2930
67
68 * ``consider-using-sys-exit`` is exempted when ``exit()`` is imported from ``sys``
69
70 Closes #3145
71
72 * Exempt annotated assignments without variable from ``class-variable-slots-conflict``
73
74 Closes #3141
75
76 * Fix ``utils.is_error`` to account for functions returning early.
77
78 This fixes a false negative with ``unused-variable`` which was no longer triggered
79 when a function raised an exception as the last instruction, but the body of the function
80 still had unused variables.
81
82 Closes #3028
83
84
85 What's New in Pylint 2.4.1?
86 ---------------------------
87 Release date: 2019-09-25
88
89
90 * Exempt type checking definitions defined in both clauses of a type checking guard
91
92 Closes #3127
93
94
95 * Exempt type checking definitions inside the type check guard
96
97 In a7f236528bb3758886b97285a56f3f9ce5b13a99 we added basic support
98 for emitting ``used-before-assignment`` if a variable was only defined
99 inside a type checking guard (using ``TYPE_CHECKING`` variable from `typing`)
100 Unfortunately that missed the case of using those type checking imports
101 inside the guard itself, which triggered spurious :ref:`used-before-assignment` errors.
102
103 Closes #3119
104
105 * Require astroid >= 2.3 to avoid any compatibility issues.
106
107
108 What's New in Pylint 2.4.0?
109 ---------------------------
110 Release date: 2019-09-24
111
112 * New check: ``import-outside-toplevel``
113
114 This check warns when modules are imported from places other than a
115 module toplevel, e.g. inside a function or a class.
116
117 * Handle inference ambiguity for ``invalid-format-index``
118
119 Closes #2752
120
121 * Removed Python 2 specific checks such as ``relative-import``,
122 ``invalid-encoded-data``, ``missing-super-argument``.
123
124 * Support forward references for ``function-redefined`` check.
125
126 Closes #2540
127
128 * Handle redefinitions in case of type checking imports.
129
130 Closes #2834
131
132 * Added a new check, ``consider-using-sys-exit``
133
134 This check is emitted when we detect that a quit() or exit() is invoked
135 instead of sys.exit(), which is the preferred way of exiting in program.
136
137 Closes #2925
138
139 * ``useless-suppression`` check now ignores ``cyclic-import`` suppressions,
140 which could lead to false positives due to incomplete context at the time
141 of the check.
142
143 Closes #3064
144
145 * Added new checks, ``no-else-break`` and ``no-else-continue``
146
147 These checks highlight unnecessary ``else`` and ``elif`` blocks after
148 ``break`` and ``continue`` statements.
149
150 Closes #2327
151
152 * Don't emit ``protected-access`` when a single underscore prefixed attribute
153 is used inside a special method
154
155 Closes #1802
156
157 * Fix the "statement" values in the PyLinter's stats reports by module.
158
159 * Added a new check, ``invalid-overridden-method``
160
161 This check is emitted when we detect that a method is overridden
162 as a property or a property is overridden as a method. This can indicate
163 a bug in the application code that will trigger a runtime error.
164
165 Closes #2670
166
167 * Added a new check, ``arguments-out-of-order``
168
169 This check warns if you have arguments with names that match those in
170 a function's signature but you are passing them in to the function
171 in a different order.
172
173 Closes #2975
174
175 * Added a new check, ``redeclared-assigned-name``
176
177 This check is emitted when ``pylint`` detects that a name
178 was assigned one or multiple times in the same assignment,
179 which indicate a potential bug.
180
181 Closes #2898
182
183 * Ignore lambda calls with variadic arguments without a context.
184
185 Inferring variadic positional arguments and keyword arguments
186 will result into empty Tuples and Dicts, which can lead in
187 some cases to false positives with regard to :ref:`no-value-for-parameter`.
188 In order to avoid this, until we'll have support for call context
189 propagation, we're ignoring such cases if detected.
190 We already did that for function calls, but the previous fix
191 was not taking in consideration ``lambdas``
192
193 Closes #2918
194
195 * Added a new check, ``self-assigning-variable``. This check is emitted
196 when we detect that a variable is assigned to itself, which might
197 indicate a potential bug in the code application.
198
199 Closes #2930
200
201 * Added a new check, ``property-with-parameters``.
202
203 This check is emitted when we detect that a defined property also
204 has parameters, which are useless.
205
206 Closes #3006
207
208 * Excluded protocol classes from a couple of checks.
209
210 Closes #3002.
211
212 * Add a check ``unnecessary-comprehension`` that detects unnecessary comprehensions.
213
214 This check is emitted when ``pylint`` finds list-, set- or dict-comprehensions,
215 that are unnecessary and can be rewritten with the list-, set- or dict-constructors.
216
217 Closes #2905
218
219 * Excluded PEP 526 instance and class variables from ``no-member``.
220
221 Closes #2945
222
223 * Excluded ``attrs`` from ``too-few-public-methods`` check.
224
225 Closes #2988.
226
227 * ``unused-import`` emitted for the right import names in function scopes.
228
229 Closes #2928
230
231 * Dropped support for Python 3.4.
232
233 * ``assignment-from-no-return`` not triggered for async methods.
234
235 Closes #2902
236
237 * Don't emit ``attribute-defined-outside-init`` for variables defined in setters.
238
239 Closes #409
240
241 * Syntax errors report the column number.
242
243 Closes #2914
244
245 * Support fully qualified typing imports for type annotations.
246
247 Closes #2915
248
249 * Exclude ``__dict__`` from ``attribute-defined-outside-init``
250
251 * Fix pointer on spelling check when the error are more than one time in the same line.
252
253 Closes #2895
254
255 * Fix crash happening when parent of called object cannot be determined
256
257 * Allow of in ``GoogleDocstring.re_multiple_type``
258
259 * Added ``subprocess-run-check`` to handle subrocess.run without explicitly set ``check`` keyword.
260
261 Closes #2848
262
263 * When we can't infer bare except handlers, skip ``try-except-raise``
264
265 Closes #2853
266
267 * Handle more ``unnecessary-lambda`` cases when dealing with additional kwargs in wrapped calls
268
269 Closes #2845
270
271 * Better postponed evaluation of annotations handling
272
273 Closes #2847
274
275 * Support postponed evaluation of annotations for variable annotations.
276
277 Closes #2838
278
279 * ``epylint.py_run`` defaults to ``python`` in case the current executable is not a Python one.
280
281 Closes #2837
282
283 * Ignore raw docstrings when running Similarities checker with ``ignore-docstrings=yes`` option
284
285 * Fix crash when calling ``inherit_from_std_ex`` on a class which is its own ancestor
286
287 Closes #2680
288
289 * Added a new check that warns the user if a function call is used inside a test but parentheses are missing.
290
291 Closes #2658
292
293 * ``len-as-condition`` now only fires when a ``len(x)`` call is made without an explicit comparison
294
295 The message and description accompanying this checker has been changed
296 reflect this new behavior, by explicitly asking to either rely on the
297 fact that empty sequence are false or to compare the length with a scalar.
298
299 Closes #2684
300
301 * Add ``preferred-module`` checker that notify if an import has a replacement module that should be used.
302
303 This check is emitted when ``pylint`` finds an imported module that has a
304 preferred replacement listed in ``preferred-modules``.
305
306 * ``assigning-non-slot`` not emitted for classes with unknown base classes.
307
308 Closes #2807
309
310 * ``old-division`` is not emitted for non-Const nodes.
311
312 Closes #2808
313
314 * Added method arguments to the dot writer for pyreverse.
315
316 Closes #2139
317
318 * Support for linting file from stdin.
319
320 IDEs may benefit from the support for linting from an in-memory file.
321
322 Closes #1187
323
324 * Added a new check ``class-variable-slots-conflict``
325
326 This check is emitted when ``pylint`` finds a class variable that conflicts with a slot
327 name, which would raise a ``ValueError`` at runtime.
328
329 * Added new check: :ref:`dict-iter-missing-items` (E1141)
330
331 Closes #2761
332
333 * Fix issue with pylint name in output of python -m pylint --version
334
335 Closes #2764
336
337 * Relicense logo material under the CC BY-SA 4.0 license.
338
339 * Skip ``if`` expressions from f-strings for the ``check_elif`` checker
340
341 Closes #2816
342
343 * C0412 (ungrouped-import) is now compatible with isort.
344
345 Closes #2806
346
347 * Added new extension to detect too much code in a try clause
348
349 Closes #2877
350
351 * ``signature-mutators`` option was added.
352 With this option, users can choose to ignore ``too-many-function-args``, ``unexpected-keyword-arg``,
353 and ``no-value-for-parameter`` for functions decorated with decorators that change
354 the signature of a decorated function.
355
356 Closes #259
357
358 * Fixed a pragma comment on its own physical line being ignored when part
359 of a logical line with the previous physical line.
360
361 Closes #199
362
363 * Fixed false ``undefined-loop-variable`` for a function defined in the loop,
364 that uses the variable defined in that loop.
365
366 Closes #202
367
368 * Fixed ``unused-argument`` and ``function-redefined`` getting raised for
369 functions decorated with ``typing.overload``.
370
371 Closes #1581
372
373 * Fixed a false positive with ``consider-using-dict-comprehension`` for constructions that can't be converted to a comprehension
374
375 Closes #2963
376
377 * Added ``__post_init__`` to ``defining-attr-methods`` in order to avoid ``attribute-defined-outside-init`` in dataclasses.
378
379 Closes #2581
380
381 * Changed description of W0199 to use the term 2-item-tuple instead of 2-uple.
382
383 * Allow a ``.`` as a prefix for Sphinx name resolution.
384
385 * Checkers must now keep a 1 to 1 relationship between "msgid" (ie: C1234) and "symbol" (i.e. : human-readable-symbol)
386
387 * In checkers, an old_names can now be used for multiple new messages and pylint is now a little faster
388
389 It means if you do a partial old_names for a message definition an exception will tell you that you
390 must rename the associated identification.
391
392 * Allow the choice of f-strings as a valid way of formatting logging strings.
393
394 Closes #2395
395
396 * Added ``--list-msgs-enabled`` command to list all enabled and disabled messages given the current RC file and command line arguments.