summaryrefslogtreecommitdiff
path: root/doc/whatsnew/2.2.rst
blob: 4a7478ffb351c2b11a479b48a1b7013b36c56403 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
**************************
 What's New in Pylint 2.2
**************************

:Release: 2.2
:Date: 2018-11-25

Summary -- Release highlights
=============================


New checkers
============

* String checker now reports format string type mismatches.

* ``duplicate-string-formatting-argument`` was added for detecting duplicate string
  formatting arguments that should be passed instead as named arguments.

* ``logging-format-style`` is a new option for the logging checker for usage of
  str.format() style format strings in calls to loggers.

  It accepts two options: ``--logging-format-style=old`` for using `%` style formatting,
  which is the assumed default, and ``--logging-format-style=new`` for using `{}` style formatting.

* ``implicit-str-concat-in-sequence`` detects string concatenation inside lists, sets & tuples.

  Example of code that would generate such warning:

  .. code-block:: python

    woops = ('a', 'b' 'c')


Other Changes
=============

* ``try-except-raise`` checker now handles multilevel inheritance hirerachy for exceptions correctly.

  Close #2484

* Ignore import x.y.z as z cases for checker ``useless-import-alias``.

* ``unnecessary-pass`` is now also emitted when a function or class contains only docstring and pass statement,
  in which case, docstring is enough for empty definition.

* Fix false positive ``undefined-variable`` and ``used-before-assignment`` with nonlocal keyword usage.

* Fix exceptions being raised when one of the params is not a ClassDef for :func:`checkers.utils.is_subclass_of`.

* ``pylint`` now picks the latest value from the inferred values of the exception that gets
  raised, when looking for ``raising-non-exception``. This helps when reusing a variable name
  for multiple types, since ``pylint`` was picking just the first inferred value, leading
  to spurious false positives.

  Close #2431

* ``pylint`` used to emit a ``not-an-iterable`` error when looking at coroutines built
  with ``asyncio.coroutine``. This is no longer the case as we handle coroutines explicitly.

  Close #996

* ``pylint`` used to emit a ``unused-variable`` error if unused import was found in the function. Now instead of
  ``unused-variable``, ``unused-import`` is emitted.

  Close #2421