Debian Codegraph @

doc/whatsnew/1/1.7/full.rst

raw
1 Full changelog
2 ==============
3
4 What's New in Pylint 1.7.1?
5 ---------------------------
6 Release date: 2017-04-17
7
8 * Fix a false positive which occurred when an exception was reraised
9
10 Closes #1419
11
12 * Fix a false positive of ``disallow-trailing-tuple``
13
14 The check was improved by verifying for non-terminating newlines, which
15 should exempt function calls and function definitions from the check
16
17 Closes #1424
18
19
20 What's New in Pylint 1.7?
21 -------------------------
22
23 Release date: 2017-04-13
24
25 * Don't emit :ref:`missing-final-newline` or :ref:`trailing-whitespace` for formfeeds (page breaks).
26
27 Closes #1218 and #1219
28
29 * Don't emit by default :ref:`no-member` if we have opaque inference objects in the inference results
30
31 This is controlled through the new flag ignore-on-opaque-inference, which is by
32 default True. The inference can return multiple potential results while
33 evaluating a Python object, but some branches might not be evaluated, which
34 results in partial inference. In that case, it might be useful to still emit
35 :ref:`no-member` and other checks for the rest of the inferred objects.
36
37 * Added new message ``assign-to-new-keyword`` to warn about assigning to names which
38 will become a keyword in future Python releases.
39
40 Closes #1351
41
42 * Split the 'missing or differing' in parameter documentation in different error.
43 :ref:`differing-param-doc` covers the differing part of the old :ref:`missing-param-doc`',
44 and :ref:`differing-type-doc`' covers the differing part of the old :ref:`missing-type-doc`'
45
46 Closes #1342
47
48 * Added a new error, :ref:`used-prior-global-declaration`', which is emitted when a name
49 is used prior a global declaration in a function. This causes a SyntaxError in
50 Python 3.6
51
52 Closes #1257
53
54 * The protocol checks are emitting their messages when a special method is set to None.
55
56 Closes #1263
57
58 * Properly detect if imported name is assigned to same name in different
59 scope.
60
61 Closes #636, #848, #851, and #900
62
63 * Require one space for annotations with type hints, as per PEP 8.
64
65 * :ref:`trailing-comma-tuple`' check was added
66
67 This message is emitted when pylint finds an one-element tuple,
68 created by a stray comma. This can suggest a potential problem in the
69 code and it is recommended to use parentheses in order to emphasise the
70 creation of a tuple, rather than relying on the comma itself.
71
72 * Don't emit :ref:`not-callable` for instances with unknown bases.
73
74 Closes #1213
75
76 * Treat keyword only arguments the same as positional arguments with regard to :ref:`unused-argument` check
77
78 * Don't try to access variables defined in a separate scope when checking for ``protected-access``
79
80 * Added new check to detect incorrect usage of len(SEQUENCE) inside
81 test conditions.
82
83 * Added new extension to detect comparisons against empty string constants
84
85 * Added new extension to detect comparisons of integers against zero
86
87 * Added new error conditions for :ref:`bad-super-call`'
88
89 Now detects ``super(type(self), self)`` and ``super(self.__class__, self)``
90 which can lead to recursion loop in derived classes.
91
92 * PyLinter.should_analyze_file has a new optional parameter, called ``is_argument``
93
94 Closes #1079
95
96 * Add attribute hints for missing members
97
98 Closes #1035
99
100 * Add a new warning, :ref:`redefined-argument-from-local`'
101
102 Closes #649
103
104 * Support inline comments for comma separated values in the config file
105
106 Closes #1024
107
108 * epylint.py_run's *script* parameter was removed.
109
110 * epylint.py_run now uses ``shell=False`` for running the underlying process.
111
112 Closes #441
113
114 * Added a new warning, :ref:`useless-super-delegation`'
115
116 Close 839.
117
118 * Added a new error, :ref:`invalid-metaclass`', raised when
119 we can detect that a class is using an improper metaclass.
120
121 Closes #579
122
123 * Added a new refactoring message, :ref:`literal-comparison`'.
124
125 Closes #786
126
127 * :ref:`arguments-differ` takes in consideration kwonlyargs and variadics
128
129 Closes #983
130
131 * Removed --optimized-ast
132
133 Fixes part of #975
134
135 * Removed --files-output option
136
137 Fixes part of #975
138
139 * Removed pylint-gui from the package.
140
141 * Removed the HTML reporter
142
143 Fixes part of #975
144
145 * ignored-argument-names is now used for ignoring arguments for :ref:`unused-variable` check.
146
147 This option was used for ignoring arguments when computing the correct number of arguments
148 a function should have, but for handling the arguments with regard
149 to :ref:`unused-variable` check, dummy-variables-rgx was used instead. Now, ignored-argument-names
150 is used for its original purpose and also for ignoring the matched arguments for
151 the :ref:`unused-variable` check. This offers a better control of what should be ignored
152 and how.
153 Also, the same option was moved from the design checker to the variables checker,
154 which means that the option now appears under the ``[VARIABLES]`` section inside
155 the configuration file.
156
157 Closes #862.
158
159 * Fix a false positive for keyword variadics with regard to keyword only arguments.
160
161 If a keyword only argument was necessary for a function, but that function was called
162 with keyword variadics (\**kwargs), then we were emitting a :ref:`missing-kwoa` false positive,
163 which is now fixed.
164
165 Closes #934.
166
167 * Fix some false positives with unknown sized variadics.
168
169 Closes #878
170
171 * Added a new extension, check_docstring, for checking PEP 257 conventions.
172
173 Closes #868.
174
175 * config files with BOM markers can now be read.
176
177 Closes #864.
178
179 * epylint.py_run does not crash on big files, using .communicate() instead of .wait()
180
181 Closes #599
182
183 * Disable reports by default and show the evaluation score by default
184
185 The reports were disabled by default in order to simplify the interaction
186 between the tool and the users. The score is still shown by default, as
187 a way of closely measuring when it increases or decreases due to changes
188 brought to the code.
189
190 Refs #746
191
192 * Disable the information category messages by default. This is a step towards
193 making pylint more sane.
194
195 Refs #746.
196
197 * Catch more cases as not proper iterables for __slots__ with
198 regard to :ref:`invalid-slots` pattern.
199
200 Closes #775
201
202 * empty indent strings are rejected.
203
204 * Added a new error, :ref:`relative-beyond-top-level`', which is emitted
205 when a relative import was attempted beyond the top level package.
206
207 Closes #588
208
209 * Added a new warning, :ref:`unsupported-assignment-operation`', which is
210 emitted when item assignment is tried on an object which doesn't
211 have this ability.
212
213 Closes #591
214
215 * Added a new warning, :ref:`unsupported-delete-operation`', which is
216 emitted when item deletion is tried on an object which doesn't
217 have this ability.
218
219 Closes #592
220
221 * Fix a false positive of :ref:`redundant-returns-doc`', occurred when the documented
222 function was using *yield* instead of *return*.
223
224 Closes #984.
225
226 * Fix false positives of 'missing-[raises|params|type]-doc' due to not
227 recognizing keyword synonyms supported by Sphinx.
228
229 * Added a new refactoring message, :ref:`consider-merging-isinstance`', which is
230 emitted whenever we can detect that consecutive isinstance calls can be
231 merged together.
232
233 Closes #968
234
235 * Fix a false positive of :ref:`missing-param-doc`' and :ref:`missing-type-doc`',
236 occurred when a class docstring uses the 'For the parameters, see'
237 magic string but the class __init__ docstring does not, or vice versa.
238
239 * ``redefined-outer-name`` is now also emitted when a nested loop's target
240 variable is the same as a target variable in an outer loop.
241
242 Closes #911.
243
244 * Added proper exception type inference for :ref:`missing-raises-doc`'.
245
246 * Added InvalidMessageError exception class to replace asserts in
247 pylint.utils.
248
249 * More thorough validation in MessagesStore.register_messages() to avoid
250 one message accidentally overwriting another.
251
252 * InvalidMessageError, UnknownMessage, and EmptyReport exceptions are
253 moved to the new pylint.exceptions submodule.
254
255 * UnknownMessage and EmptyReport are renamed to UnknownMessageError and
256 EmptyReportError.
257
258 * Warnings 'missing-returns-type-doc' and 'missing-yields-type-doc'
259 have each been split into two warnings - 'missing-[return|yield]-doc'
260 and 'missing-[return|yield]-type-doc'.
261
262 * Added epytext support to docparams extension.
263
264 Closes #1029
265
266 * Support having plugins with the same name and with options defined
267
268 Closes #1018
269
270 * Sort configuration options in a section
271
272 Closes #1087
273
274 * Added a new Python 3 warning around implementing '__div__', '__idiv__', or
275 '__rdiv__' as those methods are phased out in Python 3.
276
277 * Added a new warning, :ref:`overlapping-except`', which is
278 emitted when two exceptions in the same except-clause are aliases
279 for each other or one exceptions is an ancestor of another.
280
281 * Avoid crashing on ill-formatted strings when checking for string formatting errors.
282
283 * Added a new Python 3 warning for calling 'str.encode' or 'str.decode' with a non-text
284 encoding.
285
286 * Added new coding convention message, :ref:`single-string-used-for-slots`'.
287
288 Closes #1166
289
290 * Added a new Python 3 check for accessing 'sys.maxint' which was removed in Python 3 in favor
291 of 'sys.maxsize'
292
293 * Added a new Python 3 check for bad imports.
294
295 * Added a new Python 3 check for accessing deprecated string functions.
296
297 * Do not warn about unused arguments or function being redefined in singledispatch
298 registered implementations.
299
300 Closes #1032 and #1034
301
302 * Added refactoring message :ref:`no-else-return`'.
303
304 * Improve :ref:`unused-variable` checker to warn about unused variables in module scope.
305
306 Closes #919
307
308 * Ignore modules import as _ when checking for unused imports.
309
310 Closes #1190
311
312 * Improve handing of Python 3 classes with metaclasses declared in nested scopes.
313
314 Closes #1177
315
316 * Added refactoring message :ref:`consider-using-ternary`'.
317
318 Closes #1204
319
320 * Bug-fix for false-positive logging-format-interpolation` when format specifications
321 are used in formatted string.
322
323 Closes #572
324
325 * Added a new switch ``single-line-class-stmt`` to allow single-line declaration
326 of empty class bodies.
327
328 Closes #738
329
330 * Protected access in form ``type(self)._attribute`` are now allowed.
331
332 Closes #1031
333
334 * Let the user modify msg-template when Pylint is called from a Python script
335
336 Closes #1269
337
338 * Imports checker supports new switch ``allow-wildcard-with-all`` which disables
339 warning on wildcard import when imported module defines ``__all__`` variable.
340
341 Closes #831
342
343 * ``too-many-format-args`` and ``too-few-format-args`` are emitted correctly when
344 starred expression are used in RHS tuple.
345
346 Closes #957
347
348 * ``cyclic-import`` checker supports local disable clauses. When one
349 of cycle imports was done in scope where disable clause was active,
350 cycle is not reported as violation.
351
352 Closes #59