Debian Codegraph @

doc/whatsnew/2/2.10/summary.rst

raw
1 :Release: 2.10
2 :Date: 2021-08-20
3
4 Summary -- Release highlights
5 =============================
6
7 In 2.10, we added several new default check, like ``unspecified-encoding``, ``forgotten-debug-statement`` or
8 ``use-dict-literal``. There's also a few opinionated optional one. You can now forbid while loop or
9 profess your exclusive love of ternary expressions publicly. We promise you hours of arguing fun with
10 your whole team if you add those to your configuration.
11
12 We've also fixed some long standing bugs, false positives, or missing options like ``ignore-signature`` that
13 will now work on inner function's signatures.
14
15 A new option to disable the next line, ``disable-next``, has been added. It's also possible to export
16 colored diagrams, and plantuml diagram using pyreverse. ``PYLINT_HOME`` is now ``XDG_CACHE_HOME`` if not set.
17
18 The performance of the similarity checker has been improved, as well as several small performance fixes.
19
20 We're going to continue working on improving performance during 2.11. We're also going to finalize
21 a new ``possible-forgotten-f-prefix`` check that had too much false positives at release time.
22 Check the `possible-forgotten-f-prefix`_ issue if you want to provide knowledge or use case :)
23
24 .. _possible-forgotten-f-prefix: https://github.com/pylint-dev/pylint/pull/4787
25
26 New checkers
27 ============
28
29 * Added ``unspecified-encoding``: Emitted when open() is called without specifying an encoding
30
31 Closes #3826
32
33 * Added ``use-list-literal``: Emitted when ``list()`` is called with no arguments instead of using ``[]``
34
35 Closes #4365
36
37 * Added ``use-dict-literal``: Emitted when ``dict()`` is called with no arguments instead of using ``{}``
38
39 Closes #4365
40
41 * Added ``forgotten-debug-statement``: Emitted when ``breakpoint``, ``pdb.set_trace`` or ``sys.breakpointhook`` calls are found
42
43 Closes #3692
44
45 * Added ``use-sequence-for-iteration``: Emitted when iterating over an in-place defined ``set``.
46
47
48 * Added ``format-string-without-interpolation`` checker: Emitted when formatting is applied to a string without any variables to be replaced
49
50 Closes #4042
51
52 * Added ``redundant-u-string-prefix`` checker: Emitted when the u prefix is added to a string
53
54 Closes #4102
55
56 Extensions
57 ==========
58
59 * ``CodeStyleChecker``
60
61 * Limit ``consider-using-tuple`` to be emitted only for in-place defined ``lists``.
62
63 * Emit ``consider-using-tuple`` even if list contains a ``starred`` expression.
64
65 * Added optional extension ``consider-ternary-expression``: Emitted whenever a variable is assigned in both branches of an if/else block.
66
67 Closes # 4366
68
69 * Added optional extension ``while-used``: Emitted whenever a ``while`` loop is used.
70
71 Closes # 4367
72
73 Other Changes
74 =============
75
76 * pyreverse now permit to produce colored generated diagram by using the ``colorized`` option.
77
78 * Pyreverse - add output in PlantUML format
79
80 * ``consider-using-with`` is no longer triggered if a context manager is returned from a function.
81
82 * pylint does not crash with a traceback anymore when a file is problematic. It
83 creates a template text file for opening an issue on the bug tracker instead.
84 The linting can go on for other non problematic files instead of being impossible.
85
86 * Pyreverse - Show class has-a relationships inferred from type-hints
87
88 * Performance of the Similarity checker has been improved.
89
90 * Added ``time.clock`` to deprecated functions/methods for python 3.3
91
92 * Added ``ignored-parents`` option to the design checker to ignore specific
93 classes from the ``too-many-ancestors`` check (R0901).
94
95 * Don't emit ``no-member`` error if guarded behind if statement.
96
97 Refs #1162
98 Closes #1990
99 Closes #4168
100
101 * Fix false positives for ``superfluous-parens`` with walrus operator, ternary operator and inside list comprehension.
102
103 Closes #2818
104 Closes #3249
105 Closes #3608
106 Closes #4346
107
108 * Refactor of ``--list-msgs`` & ``--list-msgs-enabled``: both options now show whether messages are emittable with the current interpreter.
109
110 Closes #4778
111
112 * Fix false negative for ``used-before-assignment`` when the variable is assigned
113 in an exception handler, but used outside of the handler.
114
115 Closes #626
116
117 * Added ``disable-next`` option: allows using `# pylint: disable-next=msgid` to disable a message for the following line
118
119 Closes #1682
120
121 * Fixed ``cell-var-from-loop`` checker: handle cell variables in comprehensions within functions,
122 and function default argument expressions. Also handle basic variable shadowing.
123
124 Closes #2846
125 Closes #3107
126
127 * Fixed bug with ``cell-var-from-loop`` checker: it no longer has false negatives when
128 both ``unused-variable`` and ``used-before-assignment`` are disabled.
129
130 * Class methods' signatures are now ignored the same way as functions' with similarities "ignore-signatures" option enabled
131
132 Closes #4653