Debian Codegraph @

doc/whatsnew/2/2.5/full.rst

raw
1 Full changelog
2 ==============
3
4 What's New in Pylint 2.5.3?
5 ---------------------------
6 Release date: 2020-06-8
7
8 * Fix a regression where disable comments that have checker names with numbers in them are not parsed correctly
9
10 Closes #3666
11
12 * ``property-with-parameters`` properly handles abstract properties
13
14 Closes #3600
15
16 * ``continue-in-finally`` no longer emitted on Python 3.8 where it's now valid
17
18 Closes #3612
19
20 * Fix a regression where messages with dash are not fully parsed
21
22 Closes #3604
23
24 * In a TOML configuration file, it's now possible to use rich (non-string) types, such as list, integer or boolean instead of strings. For example, one can now define a *list* of message identifiers to enable like this::
25
26 enable = [
27 "use-symbolic-message-instead",
28 "useless-suppression",
29 ]
30
31 Closes #3538
32
33 * Fix a regression where the score was not reported with multiple jobs
34
35 Closes #3547
36
37 * Protect against ``AttributeError`` when checking ``cell-var-from-loop``
38
39 Closes #3646
40
41
42 What's New in Pylint 2.5.2?
43 ---------------------------
44 Release date: 2020-05-05
45
46 * ``pylint.Run`` accepts ``do_exit`` as a deprecated parameter
47
48 Closes #3590
49
50
51 What's New in Pylint 2.5.1?
52 ---------------------------
53 Release date: 2020-05-05
54
55 * Fix a crash in ``method-hidden`` lookup for unknown base classes
56
57 Closes #3527
58
59 * Revert pylint.Run's ``exit`` parameter to ``do_exit``
60
61 This has been inadvertently changed several releases ago to ``do_exit``.
62
63 Closes #3533
64
65 * ``no-value-for-parameter`` variadic detection has improved for assign statements
66
67 Closes #3563
68
69 * Allow package files to be properly discovered with multiple jobs
70
71 Closes #3524
72
73 * Allow linting directories without ``__init__.py`` which was a regression in 2.5.
74
75 Closes #3528
76
77
78 What's New in Pylint 2.5.0?
79 ---------------------------
80 Release date: 2020-04-27
81
82 * Fix a false negative for ``undefined-variable`` when using class attribute in comprehension.
83
84 Closes #3494
85
86 * Fix a false positive for ``undefined-variable`` when using class attribute in decorator or as type hint.
87
88 Closes #511
89 Closes #1976
90
91 * Remove HTML quoting of messages in JSON output.
92
93 Closes #2769
94
95 * Adjust the ``invalid-name`` rule to work with non-ASCII identifiers and add the ``non-ascii-name`` rule.
96
97 Closes #2725
98
99 * Positional-only arguments are taken in account for ``useless-super-delegation``
100
101 * ``unidiomatic-typecheck`` is no longer emitted for ``in`` and ``not in`` operators
102
103 Closes #3337
104
105 * Positional-only argument annotations are taken in account for ``unused-import``
106
107 Closes #3462
108
109 * Add a command to list available extensions.
110
111 * Allow used variables to be properly consumed when different checks are enabled / disabled
112
113 Closes #3445
114
115 * Fix :ref:`dangerous-default-value` rule to account for keyword argument defaults
116
117 Closes #3373
118
119 * Fix a false positive of ``self-assigning-variable`` on tuple unpacking.
120
121 Closes #3433
122
123 * ``no-self-use`` is no longer emitted for typing stubs.
124
125 Closes #3439
126
127 * Fix a false positive for ``undefined-variable`` when ``__class__`` is used
128
129 Closes #3090
130
131 * Emit ``invalid-name`` for variables defined in loops at module level.
132
133 Closes #2695
134
135 * Add a check for cases where the second argument to ``isinstance`` is not a type.
136
137 Closes #3308
138
139 * Add 'notes-rgx' option, to be used for fixme check.
140
141 Closes #2874
142
143 * ``function-redefined`` exempts function redefined on a condition.
144
145 Closes #2410
146
147 * ``typing.overload`` functions are exempted from docstring checks
148
149 Closes #3350
150
151 * Emit ``invalid-overridden-method`` for improper async def overrides.
152
153 Closes #3355
154
155 * Do not allow ``python -m pylint ...`` to import user code
156
157 ``python -m pylint ...`` adds the current working directory as the first element
158 of ``sys.path``. This opens up a potential security hole where ``pylint`` will import
159 user level code as long as that code resides in modules having the same name as stdlib
160 or pylint's own modules.
161
162 Closes #3386
163
164 * Add ``dummy-variables-rgx`` option for ``_redeclared-assigned-name`` check.
165
166 Closes #3341
167
168 * Fixed graph creation for relative paths
169
170 * Add a check for asserts on string literals.
171
172 Closes #3284
173
174 * ``not in`` is considered iterating context for some of the Python 3 porting checkers.
175
176 * A new check ``inconsistent-quotes`` was added.
177
178 * Add a check for non string assignment to __name__ attribute.
179
180 Closes #583
181
182 * ``__pow__``, ``__imatmul__``, ``__trunc__``, ``__floor__``, and ``__ceil__`` are recognized as special method names.
183
184 Closes #3281
185
186 * Added errors for protocol functions when invalid return types are detected.
187 E0304 (:ref:`invalid-bool-returned`): __bool__ did not return a bool
188 E0305 (:ref:`invalid-index-returned`): __index__ did not return an integer
189 E0306 (:ref:`invalid-repr-returned`): __repr__ did not return a string
190 E0307 (:ref:`invalid-str-returned`): __str__ did not return a string
191 E0308 (:ref:`invalid-bytes-returned`): __bytes__ did not return a string
192 E0309 (:ref:`invalid-hash-returned`): __hash__ did not return an integer
193 E0310 (:ref:`invalid-length-hint-returned`): __length_hint__ did not return a non-negative integer
194 E0311 (:ref:`invalid-format-returned`): __format__ did not return a string
195 E0312 (:ref:`invalid-getnewargs-returned`): __getnewargs__ did not return a tuple
196 E0313 (:ref:`invalid-getnewargs-ex-returned`): __getnewargs_ex__ did not return a tuple of the form (tuple, dict)
197
198 Closes #560
199
200 * ``missing-*-docstring`` can look for ``__doc__`` assignments.
201
202 Closes #3301
203
204 * ``undefined-variable`` can now find undefined loop iterables
205
206 Closes #498
207
208 * ``safe_infer`` can infer a value as long as all the paths share the same type.
209
210 Closes #2503
211
212 * Add a --fail-under <score> flag, also configurable in a .pylintrc file. If the final score is more than the specified score, it's considered a success and pylint exits with exitcode 0. Otherwise, it's considered a failure and pylint exits with its current exitcode based on the messages issued.
213
214 Closes #2242
215
216 * Don't emit ``line-too-long`` for multilines when ``disable=line-too-long`` comment stands at their end
217
218 Closes #2957
219
220 * Fixed an ``AttributeError`` caused by improper handling of ``dataclasses`` inference in ``pyreverse``
221
222 Closes #3256
223
224 * Do not exempt bare except from ``undefined-variable`` and similar checks
225
226 If a node was wrapped in a ``TryExcept``, ``pylint`` was taking a hint
227 from the except handler when deciding to emit or not a message.
228 We were treating bare except as a fully fledged ignore but only
229 the corresponding exceptions should be handled that way (e.g. ``NameError`` or ``ImportError``)
230
231 Closes #3235
232
233 * No longer emit ``assignment-from-no-return`` when a function only raises an exception
234
235 Closes #3218
236
237 * Allow import aliases to exempt ``import-error`` when used in type annotations.
238
239 Closes #3178
240
241 * ``Ellipsis` is exempted from ``multiple-statements`` for function overloads.
242
243 Closes #3224
244
245 * No longer emit ``invalid-name`` for non-constants found at module level.
246
247 Pylint was taking the following statement from PEP-8 too far, considering
248 all module level variables as constants, which is not what the statement is saying:
249
250 `Constants are usually defined on a module level and written in
251 all capital letters with underscores separating words.`
252
253 Closes #3111
254 Closes #3132
255
256 * Allow ``implicit-str-concat-in-sequence`` to be emitted for string juxtaposition
257
258 Closes #3030
259
260 * ``implicit-str-concat-in-sequence`` was renamed ``implicit-str-concat``
261
262 * The ``json`` reporter no longer bypasses ``redirect_stdout``.
263
264 Closes #3227
265
266 * Move ``NoFileError``, ``OutputLine``, ``FunctionalTestReporter``,
267 ``FunctionalTestFile``, ``LintModuleTest`` and related methods from
268 ``test_functional.py`` to ``pylint.testutils`` to help testing for 3rd
269 party pylint plugins.
270
271 * Can read config from a setup.cfg or pyproject.toml file.
272
273 Closes #617
274
275 * Fix exception-escape false positive with generators
276
277 Closes #3128
278
279 * ``inspect.getargvalues`` is no longer marked as deprecated.
280
281 * A new check ``f-string-without-interpolation`` was added
282
283 Closes #3190
284
285 * Flag mutable ``collections.*`` utilities as dangerous defaults
286
287 Closes #3183
288
289 * ``docparams`` extension supports multiple types in raises sections.
290
291 Multiple types can also be separated by commas in all valid sections.
292
293 Closes #2729
294
295 * Allow parallel linting when run under Prospector
296
297 * Fixed false positives of ``method-hidden`` when a subclass defines the method that is being hidden.
298
299 Closes #414
300
301 * Python 3 porting mode is 30-50% faster on most codebases
302
303 * Python 3 porting mode no longer swallows syntax errors
304
305 Closes #2956
306
307 * Pass the actual PyLinter object to sub processes to allow using custom
308 PyLinter classes.
309
310 PyLinter object (and all its members except reporter) needs to support
311 pickling so the PyLinter object can be passed to worker processes.
312
313 * Clean up setup.py
314
315 Make pytest-runner a requirement only if running tests, similar to McCabe.
316
317 Clean up the setup.py file, resolving a number of warnings around it.
318
319 * Handle SyntaxError in files passed via ``--from-stdin`` option
320
321 Pylint no longer outputs a traceback, if a file, read from stdin,
322 contains a syntaxerror.
323
324 * Fix uppercase style to disallow 3+ uppercase followed by lowercase.
325
326 * Fixed ``undefined-variable`` and ``unused-import`` false positives
327 when using a metaclass via an attribute.
328
329 Closes #1603
330
331 * Emit ``unused-argument`` for functions that partially uses their argument list before raising an exception.
332
333 Closes #3246
334
335 * Fixed ``broad_try_clause`` extension to check try/finally statements and to
336 check for nested statements (e.g., inside of an ``if`` statement).
337
338 * Recognize classes explicitly inheriting from ``abc.ABC`` or having an
339 ``abc.ABCMeta`` metaclass as abstract. This makes them not trigger W0223.
340
341 Closes #3098
342
343 * Fix overzealous ``arguments-differ`` when overridden function uses variadics
344
345 No message is emitted if the overriding function provides positional or
346 keyword variadics in its signature that can feasibly accept and pass on
347 all parameters given by the overridden function.
348
349 Closes #1482
350 Closes #1553
351
352 * Multiple types of string formatting are allowed in logging functions.
353
354 The ``logging-fstring-interpolation`` message has been brought back to allow
355 multiple types of string formatting to be used.
356
357 Closes #3361