Debian Codegraph @

doc/whatsnew/1/1.4.rst

raw
1 **************************
2 What's New In Pylint 1.4
3 **************************
4
5 What's New in Pylint 1.4.3?
6 ===========================
7 Release date: 2015-03-14
8
9 * Remove three warnings: star-args, abstract-class-little-used,
10 abstract-class-not-used. These warnings don't add any real value
11 and they don't imply errors or problems in the code.
12
13 * Added a new option for controlling the peephole optimizer in astroid.
14 The option ``--optimize-ast`` will control the peephole optimizer,
15 which is used to optimize a couple of AST subtrees. The current problem
16 solved by the peephole optimizer is when multiple joined strings,
17 with the addition operator, are encountered. If the numbers of such
18 strings is high enough, Pylint will then fail with a maximum recursion
19 depth exceeded error, due to its visitor architecture. The peephole
20 just transforms such calls, if it can, into the final resulting string
21 and this exhibit a problem, because the visit_binop method stops being
22 called (in the optimized AST it will be a Const node).
23
24
25 What's New in Pylint 1.4.2?
26 ===========================
27 Release date: 2015-03-11
28
29 * Don't require a docstring for empty modules.
30
31 Closes #261
32
33 * Fix a false positive with ``too-few-format-args`` string warning,
34 emitted when the string format contained a normal positional
35 argument ('{0}'), mixed with a positional argument which did
36 an attribute access ('{0.__class__}').
37
38 Closes #463
39
40 * Take in account all the methods from the ancestors
41 when checking for :ref:`too-few-public-methods`.
42
43 Closes #471
44
45 * Catch enchant errors and emit :ref:`invalid-characters-in-docstring`
46 when checking for spelling errors.
47
48 Closes #469
49
50 * Use all the inferred statements for the :ref:`super-init-not-called`
51 check.
52
53 Closes #389
54
55 * Add a new warning, 'unichr-builtin', emitted by the Python 3
56 porting checker, when the unichr builtin is found.
57
58 Closes #472
59
60 * Add a new warning, 'intern-builtin', emitted by the Python 3
61 porting checker, when the intern builtin is found.
62
63 Closes #473
64
65 * Add support for editable installations.
66
67 * The HTML output accepts the ``--msg-template`` option. Patch by
68 Dan Goldsmith.
69
70 * Add 'map-builtin-not-iterating' (replacing 'implicit-map-evaluation'),
71 'zip-builtin-not-iterating', 'range-builtin-not-iterating', and
72 'filter-builtin-not-iterating' which are emitted by ``--py3k`` when the
73 appropriate built-in is not used in an iterating context (semantics
74 taken from 2to3).
75
76 * Add a new warning, :ref:`unidiomatic-typecheck`, emitted when an explicit
77 typecheck uses type() instead of isinstance(). For example,
78 `type(x) == Y` instead of `isinstance(x, Y)`. Patch by Chris Rebert.
79
80 Closes #299
81
82 * Add support for combining the Python 3 checker mode with the --jobs
83 flag (--py3k and --jobs).
84
85 Closes #467
86
87 * Add a new warning for the Python 3 porting checker, 'using-cmp-argument',
88 emitted when the ``cmp`` argument for the ``list.sort`` or ``sorted builtin``
89 is encountered.
90
91 * Make the --py3k flag commutative with the -E flag. Also, this patch
92 fixes the leaks of error messages from the Python 3 checker when
93 the errors mode was activated.
94
95 Closes #437
96
97
98 What's New in Pylint 1.4.1?
99 ===========================
100 Release date: 2015-01-16
101
102 * Look only in the current function's scope for :ref:`bad-super-call`.
103
104 Closes #403
105
106 * Check the return of properties when checking for :ref:`not-callable`.
107
108 Closes #406
109
110 * Warn about using the input() or round() built-ins for Python 3.
111
112 Closes #411
113
114 * Proper abstract method lookup while checking for :ref:`abstract-class-instantiated`.
115
116 Closes #401
117
118 * Use a mro traversal for finding abstract methods.
119
120 Closes #415
121
122 * Fix a false positive with :ref:`catching-non-exception` and tuples of exceptions.
123
124 * Fix a false negative with :ref:`raising-non-exception`, when the raise used
125 an uninferrable exception context.
126
127 * Fix a false positive on Python 2 for :ref:`raising-bad-type`, when
128 raising tuples in the form 'raise (ZeroDivisionError, None)'.
129
130 * Fix a false positive with invalid-slots-objects, where the slot entry
131 was a unicode string on Python 2.
132
133 Closes #421
134
135 * Add a new warning, :ref:`redundant-unittest-assert`, emitted when using
136 unittest's methods assertTrue and assertFalse with constant value
137 as argument. Patch by Vlad Temian.
138
139 * Add a new JSON reporter, usable through -f flag.
140
141 * Add the method names for the :ref:`signature-differs` and 'argument-differs'
142 warnings.
143
144 Closes #433
145
146 * Don't compile test files when installing.
147
148 * Fix a crash which occurred when using multiple jobs and the files
149 given as argument didn't exist at all.
150
151 What's New in Pylint 1.4.0?
152 ===========================
153 Release date: 2014-11-23
154
155 * Added new options for controlling the loading of C extensions.
156 By default, only C extensions from the stdlib will be loaded
157 into the active Python interpreter for inspection, because they
158 can run arbitrary code on import. The option
159 ``--extension-pkg-whitelist`` can be used to specify modules
160 or packages that are safe to load.
161
162 * Change default max-line-length to 100 rather than 80
163
164 * Drop BaseRawChecker class which were only there for backward
165 compatibility for a while now
166
167 * Don't try to analyze string formatting with objects coming from
168 function arguments.
169
170 Closes #373
171
172 * Port source code to be Python 2/3 compatible. This drops the
173 need for 2to3, but does drop support for Python 2.5.
174
175 * Each message now comes with a confidence level attached, and
176 can be filtered base on this level. This allows to filter out
177 all messages that were emitted even though an inference failure
178 happened during checking.
179
180 * Improved presenting :ref:`unused-import` message.
181
182 Closes #293
183
184 * Add new checker for finding spelling errors. New messages:
185 :ref:`wrong-spelling-in-comment`, :ref:`wrong-spelling-in-docstring`.
186 New options: spelling-dict, spelling-ignore-words.
187
188 * Add new '-j' option for running checks in sub-processes.
189
190 * Added new checks for line endings if they are mixed (LF vs CRLF)
191 or if they are not as expected. New messages: :ref:`mixed-line-endings`,
192 :ref:`unexpected-line-ending-format`. New option: expected-line-ending-format.
193
194 * :ref:`dangerous-default-value` no longer evaluates the value of the arguments,
195 which could result in long error messages or sensitive data being leaked.
196
197 Closes #282
198
199 * Fix a false positive with string formatting checker, when
200 encountering a string which uses only position-based arguments.
201
202 Closes #285
203
204 * Fix a false positive with string formatting checker, when using
205 keyword argument packing.
206
207 Closes #288
208
209 * Proper handle class level scope for lambdas.
210
211 * Handle :ref:`too-few-format-args` or :ref:`too-many-format-args` for format
212 strings with both named and positional fields.
213
214 Closes #286
215
216 * Analyze only strings by the string format checker.
217
218 Closes #287
219
220 * Properly handle nested format string fields.
221
222 Closes #294
223
224 * Don't emit :ref:`attribute-defined-outside-init` if the attribute
225 was set by a function call in a defining method.
226
227 Closes #192
228
229 * Properly handle unicode format strings for Python 2.
230
231 Closes #296
232
233 * Don't emit :ref:`import-error` if an import was protected by a try-except,
234 which excepted ImportError.
235
236 * Fix an :ref:`unused-import` false positive, when the error was emitted
237 for all the members imported with 'from import' form.
238
239 Closes #304
240
241 * Don't emit :ref:`invalid-name` when assigning a name in an
242 ImportError handler.
243
244 Closes #302
245
246 * Don't count branches from nested functions.
247
248 * Fix a false positive with :ref:`too-few-format-args`, when the format
249 strings contains duplicate manual position arguments.
250
251 Closes #310
252
253 * fixme regex handles comments without spaces after the hash.
254
255 Closes #311
256
257 * Don't emit :ref:`unused-import` when a special object is imported
258 (__all__, __doc__ etc.).
259
260 Closes #309
261
262 * Look in the metaclass, if defined, for members not found in the current
263 class.
264
265 Closes #306
266
267 * Don't emit :ref:`protected-access` if the attribute is accessed using
268 a property defined at the class level.
269
270 * Detect calls of the parent's __init__, through a binded super() call.
271
272 * Check that a class has an explicitly defined metaclass before
273 emitting 'old-style-class' for Python 2.
274
275 * Emit :ref:`catching-non-exception` for non-class nodes.
276
277 Closes #303
278
279 * Order of reporting is consistent.
280
281 * Add a new warning, :ref:`boolean-datetime`, emitted when an instance
282 of 'datetime.time' is used in a boolean context.
283
284 Closes #239
285
286 * Fix a crash which occurred while checking for :ref:`method-hidden`,
287 when the parent frame was something different than a function.
288
289 * Generate html output for missing files.
290
291 Closes #320
292
293 * Fix a false positive with :ref:`too-many-format-args`, when the format
294 string contains mixed attribute access arguments and manual
295 fields.
296
297 Closes #322
298
299 * Extend the cases where :ref:`undefined-variable` and :ref:`used-before-assignment`
300 can be detected.
301
302 Closes #291
303
304 * Add support for customising callback identifiers, by adding a new
305 '--callbacks' command line option.
306
307 Closes #326
308
309 * Add a new warning, :ref:`logging-format-interpolation`, emitted when .format()
310 string interpolation is used within logging function calls.
311
312 * Don't emit :ref:`unbalanced-tuple-unpacking` when the rhs of the assignment
313 is a variable length argument.
314
315 Closes #329
316
317 * Add a new warning, :ref:`inherit-non-class`, emitted when a class inherits
318 from something which is not a class.
319
320 Closes #331
321
322 * Fix another false positives with :ref:`undefined-variable`, where the variable
323 can be found as a class assignment and used in a function annotation.
324
325 Closes #342
326
327 * Handle assignment of the string format method to a variable.
328
329 Closes #351
330
331 * Support wheel packaging format for PyPi.
332
333 Closes #334
334
335 * Check that various built-ins that do not exist in Python 3 are not
336 used: apply, basestring, buffer, cmp, coerce, execfile, file, long
337 raw_input, reduce, StandardError, unicode, reload and xrange.
338
339 * Warn for magic methods which are not used in any way in Python 3:
340 __coerce__, __delslice__, __getslice__, __setslice__, __cmp__,
341 __oct__, __nonzero__ and __hex__.
342
343 * Don't emit :ref:`assigning-non-slot` when the assignment is for a property.
344
345 Closes #359
346
347 * Fix for regression: '{path}' was no longer accepted in '--msg-template'.
348
349 * Report the percentage of all messages, not just for errors and warnings.
350
351 Closes #319
352
353 * :ref:`too-many-public-methods` is reported only for methods defined in a class,
354 not in its ancestors.
355
356 Closes #248
357
358 * :ref:`too-many-lines` disable pragma can be located on any line, not only the
359 first.
360
361 Closes #321
362
363 * Warn in Python 2 when an import statement is found without a
364 corresponding ``from __future__ import absolute_import``.
365
366 * Warn in Python 2 when a non-floor division operation is found without
367 a corresponding ``from __future__ import division``.
368
369 * Add a new option, 'exclude-protected', for excluding members
370 from the :ref:`protected-access` warning.
371
372 Closes #48
373
374 * Warn in Python 2 when using dict.iter*(), dict.view*(); none of these
375 methods are available in Python 3.
376
377 * Warn in Python 2 when calling an object's next() method; Python 3 uses
378 __next__() instead.
379
380 * Warn when assigning to __metaclass__ at a class scope; in Python 3 a
381 metaclass is specified as an argument to the 'class' statement.
382
383 * Warn when performing parameter tuple unpacking; it is not supported in
384 Python 3.
385
386 * :ref:`abstract-class-instantiated` is also emitted for Python 2.
387 It was previously disabled.
388
389 * Add 'long-suffix' error, emitted when encountering the long suffix
390 on numbers.
391
392 * Add support for disabling a checker, by specifying an 'enabled'
393 attribute on the checker class.
394
395 * Add a new CLI option, --py3k, for enabling Python 3 porting mode. This
396 mode will disable all other checkers and will emit warnings and
397 errors for constructs which are invalid or removed in Python 3.
398
399 * Add 'old-octal-literal' to Python 3 porting checker, emitted when
400 encountering octals with the old syntax.
401
402 * Add 'implicit-map-evaluation' to Python 3 porting checker, emitted
403 when encountering the use of map builtin, without explicit evaluation.