summaryrefslogtreecommitdiff
path: root/doc/whatsnew/2/2.17/index.rst
blob: cd14488b72ab40cbe699db0a9fad1915e3ae498b (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
***************************
 What's New in Pylint 2.17
***************************

.. toctree::
   :maxdepth: 2

:Release: 2.17
:Date: 2023-03-08

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

2.17 is a small release that is the first to support python 3.11
officially with the addition of TryStar nodes.

There's still two new default checks: ``bad-chained-comparison`` and
``implicit-flag-alias``, one of them already fixed a previously
undetected bug in sentry.

Thanks to the community effort our documentation is almost complete,
and every messages should have a proper documentation now. A big thank
you to everyone who participated !

The next release is going to be ``3.0.0``, bring breaking changes and enact long
announced deprecations. There's going to be frequent beta releases,
before the official releases, everyone is welcome to try the betas
so we find problems before the actual release.

.. towncrier release notes start

What's new in Pylint 2.17.4?
----------------------------
Release date: 2023-05-06


False Positives Fixed
---------------------

- Fix a false positive for ``bad-dunder-name`` when there is a user-defined
  ``__index__`` method.

  Closes #8613 (`#8613 <https://github.com/PyCQA/pylint/issues/8613>`_)



Other Bug Fixes
---------------

- ``pyreverse``: added escaping of vertical bar character in annotation labels
  produced by DOT printer to ensure it is not treated as field separator of
  record-based nodes.

  Closes #8603 (`#8603 <https://github.com/PyCQA/pylint/issues/8603>`_)

- Fixed a crash when generating a configuration file:
  ``tomlkit.exceptions.TOMLKitError: Can't add a table to a dotted key``
  caused by tomlkit ``v0.11.8``.

  Closes #8632 (`#8632 <https://github.com/PyCQA/pylint/issues/8632>`_)


What's new in Pylint 2.17.3?
----------------------------
Release date: 2023-04-24


False Positives Fixed
---------------------

- Fix `unused-argument` false positive when `__new__` does not use all the
  arguments of `__init__`.

  Closes #3670 (`#3670 <https://github.com/PyCQA/pylint/issues/3670>`_)

- Fix ``unused-import`` false positive for usage of ``six.with_metaclass``.

  Closes #7506 (`#7506 <https://github.com/PyCQA/pylint/issues/7506>`_)

- `logging-not-lazy` is not longer emitted for explicitly concatenated string
  arguments.

  Closes #8410 (`#8410 <https://github.com/PyCQA/pylint/issues/8410>`_)

- Fix false positive for isinstance-second-argument-not-valid-type when union
  types contains None.

  Closes #8424 (`#8424 <https://github.com/PyCQA/pylint/issues/8424>`_)

- Fixed `unused-import` so that it observes the `dummy-variables-rgx` option.

  Closes #8500 (`#8500 <https://github.com/PyCQA/pylint/issues/8500>`_)

- `Union` typed variables without assignment are no longer treated as
  `TypeAlias`.

  Closes #8540 (`#8540 <https://github.com/PyCQA/pylint/issues/8540>`_)

- Fix false positive for ``positional-only-arguments-expected`` when a function
  contains both a positional-only parameter that has a default value, and
  ``**kwargs``.

  Closes #8555 (`#8555 <https://github.com/PyCQA/pylint/issues/8555>`_)

- Fix false positive for ``keyword-arg-before-vararg`` when a positional-only
  parameter with a default value precedes ``*args``.

  Closes #8570 (`#8570 <https://github.com/PyCQA/pylint/issues/8570>`_)



Other Bug Fixes
---------------

- Improve output of ``consider-using-generator`` message for ``min()` calls
  with ``default`` keyword.

  Closes #8563 (`#8563 <https://github.com/PyCQA/pylint/issues/8563>`_)


What's new in Pylint 2.17.2?
----------------------------
Release date: 2023-04-03


False Positives Fixed
---------------------

- ``invalid-name`` now allows for integers in ``typealias`` names:
  - now valid: ``Good2Name``, ``GoodName2``.
  - still invalid: ``_1BadName``.

  Closes #8485 (`#8485 <https://github.com/PyCQA/pylint/issues/8485>`_)

- No longer consider ``Union`` as type annotation as type alias for naming
  checks.

  Closes #8487 (`#8487 <https://github.com/PyCQA/pylint/issues/8487>`_)

- ``unnecessary-lambda`` no longer warns on lambdas which use its parameters in
  their body (other than the final arguments), e.g.
  ``lambda foo: (bar if foo else baz)(foo)``.

  Closes #8496 (`#8496 <https://github.com/PyCQA/pylint/issues/8496>`_)



Other Bug Fixes
---------------

- Fix a crash in pyreverse when "/" characters are used in the output filename
  e.g pyreverse -o png -p name/ path/to/project.

  Closes #8504 (`#8504 <https://github.com/PyCQA/pylint/issues/8504>`_)


What's new in Pylint 2.17.1?
----------------------------
Release date: 2023-03-22


False Positives Fixed
---------------------

- Adds ``asyncSetUp`` to the default ``defining-attr-methods`` list to silence
  ``attribute-defined-outside-init`` warning when using
  ``unittest.IsolatedAsyncioTestCase``.

  Refs #8403 (`#8403 <https://github.com/PyCQA/pylint/issues/8403>`_)



Other Bug Fixes
---------------

- ``--clear-cache-post-run`` now also clears LRU caches for pylint utilities
  holding references to AST nodes.

  Closes #8361 (`#8361 <https://github.com/PyCQA/pylint/issues/8361>`_)

- Fix a crash when ``TYPE_CHECKING`` is used without importing it.

  Closes #8434 (`#8434 <https://github.com/PyCQA/pylint/issues/8434>`_)

- Fix a regression of ``preferred-modules`` where a partial match was used
  instead of the required full match.

  Closes #8453 (`#8453 <https://github.com/PyCQA/pylint/issues/8453>`_)



Internal Changes
----------------

- The following utilities are deprecated in favor of the more robust
  ``in_type_checking_block``
  and will be removed in pylint 3.0:

    - ``is_node_in_guarded_import_block``
    - ``is_node_in_typing_guarded_import_block``
    - ``is_typing_guard``

  ``is_sys_guard`` is still available, which was part of
  ``is_node_in_guarded_import_block``.

  Refs #8433 (`#8433 <https://github.com/PyCQA/pylint/issues/8433>`_)


What's new in Pylint 2.17.0?
----------------------------
Release date: 2023-03-08


New Features
------------

- `pyreverse` now supports custom color palettes with the `--color-palette`
  option.

  Closes #6738 (`#6738 <https://github.com/PyCQA/pylint/issues/6738>`_)

- Add ``invalid-name`` check for ``TypeAlias`` names.

  Closes #7081. (`#7081 <https://github.com/PyCQA/pylint/issues/7081>`_)

- Accept values of the form ``<class name>.<attribute name>`` for the
  ``exclude-protected`` list.

  Closes #7343 (`#7343 <https://github.com/PyCQA/pylint/issues/7343>`_)

- Add `--version` option to `pyreverse`.

  Refs #7851 (`#7851 <https://github.com/PyCQA/pylint/issues/7851>`_)

- Adds new functionality with preferred-modules configuration to detect
  submodules.

  Refs #7957 (`#7957 <https://github.com/PyCQA/pylint/issues/7957>`_)

- Support implicit namespace packages (PEP 420).

  Closes #8154 (`#8154 <https://github.com/PyCQA/pylint/issues/8154>`_)

- Add globbing pattern support for ``--source-roots``.

  Closes #8290 (`#8290 <https://github.com/PyCQA/pylint/issues/8290>`_)

- Support globbing pattern when defining which file/directory/module to lint.

  Closes #8310 (`#8310 <https://github.com/PyCQA/pylint/issues/8310>`_)

- pylint now supports ``TryStar`` nodes from Python 3.11 and should be fully
  compatible with Python 3.11.

  Closes #8387 (`#8387 <https://github.com/PyCQA/pylint/issues/8387>`_)



New Checks
----------

- Add a ``bad-chained-comparison`` check that emits a warning when
  there is a chained comparison where one expression is semantically
  incompatible with the other.

  Closes #6559 (`#6559 <https://github.com/PyCQA/pylint/issues/6559>`_)

- Adds an ``implicit-flag-alias`` check that emits a warning when a class
  derived from ``enum.IntFlag`` assigns distinct integer values that share
  common bit positions.

  Refs #8102 (`#8102 <https://github.com/PyCQA/pylint/issues/8102>`_)



False Positives Fixed
---------------------

- Fix various false positives for functions that return directly from
  structural pattern matching cases.

  Closes #5288 (`#5288 <https://github.com/PyCQA/pylint/issues/5288>`_)

- Fix false positive for ``used-before-assignment`` when
  ``typing.TYPE_CHECKING`` is used with if/elif/else blocks.

  Closes #7574 (`#7574 <https://github.com/PyCQA/pylint/issues/7574>`_)

- Fix false positive for isinstance-second-argument-not-valid-type with union
  types.

  Closes #8205 (`#8205 <https://github.com/PyCQA/pylint/issues/8205>`_)

- Fix false positive for ``used-before-assignment`` for named expressions
  appearing after the first element in a list, tuple, or set.

  Closes #8252 (`#8252 <https://github.com/PyCQA/pylint/issues/8252>`_)

- Fix false positive for ``wrong-spelling-in-comment`` with class names in a
  python 2 type comment.

  Closes #8370 (`#8370 <https://github.com/PyCQA/pylint/issues/8370>`_)



False Negatives Fixed
---------------------

- Fix a false negative for 'missing-parentheses-for-call-in-test' when
  inference
  failed for the internal of the call as we did not need that information to
  raise
  correctly.

  Refs #8185 (`#8185 <https://github.com/PyCQA/pylint/issues/8185>`_)

- Fix false negative for inconsistent-returns with while-loops.

  Closes #8280 (`#8280 <https://github.com/PyCQA/pylint/issues/8280>`_)



Other Bug Fixes
---------------

- Fix ``used-before-assignment`` false positive when the walrus operator
  is used with a ternary operator in dictionary key/value initialization.

  Closes #8125 (`#8125 <https://github.com/PyCQA/pylint/issues/8125>`_)

- Fix ``no-name-in-module`` false positive raised when a package defines a
  variable with the
  same name as one of its submodules.

  Closes #8148 (`#8148 <https://github.com/PyCQA/pylint/issues/8148>`_)

- Fix a crash happening for python interpreter < 3.9 following a failed typing
  update.

  Closes #8161 (`#8161 <https://github.com/PyCQA/pylint/issues/8161>`_)

- Fix ``nested-min-max`` suggestion message to indicate it's possible to splat
  iterable objects.

  Closes #8168 (`#8168 <https://github.com/PyCQA/pylint/issues/8168>`_)

- Fix a crash happening when a class attribute was negated in the start
  argument of an enumerate.

  Closes #8207 (`#8207 <https://github.com/PyCQA/pylint/issues/8207>`_)

- Prevent emitting ``invalid-name`` for the line on which a ``global``
  statement is declared.

  Closes #8307 (`#8307 <https://github.com/PyCQA/pylint/issues/8307>`_)



Other Changes
-------------

- Update explanation for ``global-variable-not-assigned`` and add confidence.

  Closes #5073 (`#5073 <https://github.com/PyCQA/pylint/issues/5073>`_)

- The governance model and the path to become a maintainer have been documented
  as
  part of our effort to guarantee that the software supply chain in which
  pylint is
  included is secure.

  Refs #8329 (`#8329 <https://github.com/PyCQA/pylint/issues/8329>`_)