/usr/share/doc/pylint-doc/html/whatsnew/1.6.html is in pylint-doc 1.6.5-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>What’s New In Pylint 1.6 — Pylint 1.6.5 documentation</title>
<link rel="stylesheet" href="../_static/nature.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.6.5',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="top" title="Pylint 1.6.5 documentation" href="../index.html" />
<link rel="up" title="What’s New in Pylint" href="index.html" />
<link rel="next" title="Pylint NEWS" href="changelog.html" />
<link rel="prev" title="What’s New in Pylint" href="index.html" />
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="changelog.html" title="Pylint NEWS"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="What’s New in Pylint"
accesskey="P">previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Pylint 1.6.5 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">What’s New in Pylint</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="what-s-new-in-pylint-1-6">
<h1>What’s New In Pylint 1.6<a class="headerlink" href="#what-s-new-in-pylint-1-6" title="Permalink to this headline">¶</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Release:</th><td class="field-body">1.6.5</td>
</tr>
<tr class="field-even field"><th class="field-name">Date:</th><td class="field-body">2016-07-07</td>
</tr>
</tbody>
</table>
<div class="section" id="summary-release-highlights">
<h2>Summary – Release highlights<a class="headerlink" href="#summary-release-highlights" title="Permalink to this headline">¶</a></h2>
<p>Nothing major.</p>
</div>
<div class="section" id="new-checkers">
<h2>New checkers<a class="headerlink" href="#new-checkers" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">We added a new recommendation check, <code class="docutils literal"><span class="pre">consider-iterating-dictionary</span></code>,
which is emitted when a dictionary is iterated by using <code class="docutils literal"><span class="pre">.keys()</span></code>.</p>
<p>For instance, the following code would trigger this warning, since
the dictionary’s keys can be iterated without calling the method explicitly.</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">dictionary</span><span class="o">.</span><span class="n">keys</span><span class="p">():</span>
<span class="o">...</span>
<span class="c1"># Can be refactored to:</span>
<span class="k">for</span> <span class="n">key</span> <span class="ow">in</span> <span class="n">dictionary</span><span class="p">:</span>
<span class="o">...</span>
</pre></div>
</div>
</li>
<li><p class="first"><code class="docutils literal"><span class="pre">trailing-newlines</span></code> check was added, which is emitted when a file has trailing newlines.</p>
</li>
<li><p class="first"><code class="docutils literal"><span class="pre">invalid-length-returned</span></code> check was added, which is emitted when the <code class="docutils literal"><span class="pre">__len__</span></code>
special method returns something else than a non-negative number. For instance, this
example is triggering it:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">Container</span><span class="p">(</span><span class="nb">object</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">__len__</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_items</span> <span class="c1"># Oups, forgot to call len() over it.</span>
</pre></div>
</div>
</li>
<li><p class="first">Add a new check to the <em>check_docs</em> extension for looking for duplicate
constructor parameters in a class constructor docstring or in a class docstring.</p>
<p>The check <code class="docutils literal"><span class="pre">multiple-constructor-doc</span></code> is emitted when the parameter is documented
in both places.</p>
</li>
<li><p class="first">We added a new extension plugin, <code class="docutils literal"><span class="pre">pylint.extensions.mccabe</span></code>, which can be used
for warning about the complexity in the code.</p>
<p>You can enable it as in:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ pylint module_or_project --load-plugins=pylint.extensions.mccabe
</pre></div>
</div>
<p>See more at <a class="reference internal" href="../extensions.html#mccabe-extension"><span class="std std-ref">Complexity checker</span></a></p>
</li>
</ul>
</div>
<div class="section" id="new-features">
<h2>New features<a class="headerlink" href="#new-features" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first"><code class="docutils literal"><span class="pre">generated-members</span></code> now supports qualified names through regular expressions.</p>
<p>For instance, for ignoring all the errors generated by <code class="docutils literal"><span class="pre">numpy.core</span></code>‘s attributes, we can
now use:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ pylint a.py --generated-members=numpy.*
</pre></div>
</div>
</li>
<li><p class="first">Add the ability to ignore files based on regex matching, with the new <code class="docutils literal"><span class="pre">--ignore-patterns</span></code> option.</p>
<p>Rather than clobber the existing <code class="docutils literal"><span class="pre">ignore</span></code> option, we decided to have a separate
option for it. For instance, for ignoring all the test files, we can now use:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ pylint myproject --ignore-patterns=test.*?py
</pre></div>
</div>
</li>
<li><p class="first">We added a new option, <code class="docutils literal"><span class="pre">redefining-builtins-modules</span></code>, which is used for
defining the modules which can redefine builtins.
<em>pylint</em> will emit an error when a builtin is redefined, such as defining
a variable called <code class="docutils literal"><span class="pre">next</span></code>. But in some cases, the builtins can be
redefined in the case they are imported from other places, different
than the <code class="docutils literal"><span class="pre">builtins</span></code> module, such is the case for <code class="docutils literal"><span class="pre">six.moves</span></code>, which
contains more forward-looking functions:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ cat a.py
# Oups, now pylint emits a redefined-builtin message.
from six.moves import open
$ pylint a.py --redefining-builtins-modules=six.moves
</pre></div>
</div>
<p>Default values: <code class="docutils literal"><span class="pre">six.moves,future.builtins</span></code></p>
</li>
</ul>
</div>
<div class="section" id="bug-fixes">
<h2>Bug fixes<a class="headerlink" href="#bug-fixes" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Fixed a bug where the top name of a qualified import was detected as an unused variable.</li>
<li>We don’t warn about <code class="docutils literal"><span class="pre">invalid-sequence-index</span></code> if the indexed object has unknown
base classes, that Pylint cannot deduce.</li>
</ul>
</div>
<div class="section" id="other-changes">
<h2>Other Changes<a class="headerlink" href="#other-changes" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">The <code class="docutils literal"><span class="pre">bad-builtin</span></code> check was moved into an extension.</p>
<p>The check was complaining about used builtin functions which
were supposed to not be used. For instance, <code class="docutils literal"><span class="pre">map</span></code> and <code class="docutils literal"><span class="pre">filter</span></code>
were falling into this category, since better alternatives can
be used, such as list comprehensions. But the check was annoying,
since using <code class="docutils literal"><span class="pre">map</span></code> or <code class="docutils literal"><span class="pre">filter</span></code> can have its use cases and as
such, we decided to move it to an extension check instead.
It can now be enabled through <code class="docutils literal"><span class="pre">--load-plugins=pylint.extensions.bad_builtin</span></code>.</p>
</li>
<li><p class="first">We use the <code class="docutils literal"><span class="pre">configparser</span></code> backport internally, for Python 2.</p>
<p>This allows having comments inside list values, in the configuration,
such as:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">disable</span><span class="o">=</span><span class="n">no</span><span class="o">-</span><span class="n">member</span><span class="p">,</span>
<span class="c1"># Don't like this check</span>
<span class="n">bad</span><span class="o">-</span><span class="n">indentation</span>
</pre></div>
</div>
</li>
<li><p class="first">We now use the <a class="reference external" href="https://pypi.python.org/pypi/isort">isort</a> package internally.</p>
<p>This improves the <code class="docutils literal"><span class="pre">`wrong-import-order</span></code> check, so now
we should have less false positives regarding the import order.</p>
</li>
<li><p class="first">We do not emit <code class="docutils literal"><span class="pre">import-error</span></code> or <code class="docutils literal"><span class="pre">no-name-in-module</span></code> for fallback import blocks by default.</p>
<p>A fallback import block can be considered a TryExcept block, which contains imports in both
branches, such as:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">try</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">urllib.request</span> <span class="k">as</span> <span class="nn">request</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="kn">import</span> <span class="nn">urllib2</span> <span class="k">as</span> <span class="nn">request</span>
</pre></div>
</div>
<p>In the case where <strong>pylint</strong> can not find one import from the <code class="docutils literal"><span class="pre">except</span></code> branch, then
it will emit an <code class="docutils literal"><span class="pre">import-error</span></code>, but this gets cumbersome when trying to write
compatible code for both Python versions. As such, we don’t check these blocks by default,
but the analysis can be enforced by using the new <code class="docutils literal"><span class="pre">--analyse-fallback-block</span></code> flag.</p>
</li>
<li><p class="first"><code class="docutils literal"><span class="pre">reimported</span></code> is emitted when the same name is imported from different module, as in:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">collections</span> <span class="k">import</span> <span class="n">deque</span><span class="p">,</span> <span class="n">OrderedDict</span><span class="p">,</span> <span class="n">deque</span>
</pre></div>
</div>
</li>
</ul>
</div>
<div class="section" id="deprecated-features">
<h2>Deprecated features<a class="headerlink" href="#deprecated-features" title="Permalink to this headline">¶</a></h2>
<ul>
<li><p class="first">The HTML support was deprecated and will be eventually removed
in Pylint 2.0.</p>
<p>This feature was lately a second class citizen in Pylint, being
often neglected and having a couple of bugs. Since we now have
the JSON reporter, this can be used as a basis for more prettier
HTML outputs than what Pylint can currently offer.</p>
</li>
<li><p class="first">The <code class="docutils literal"><span class="pre">--files-output</span></code> option was deprecated and will be eventually
removed in Pylint 2.0.</p>
</li>
<li><p class="first">The <code class="docutils literal"><span class="pre">--optimize-ast</span></code> option was deprecated and will be eventually
removed in Pylint 2.0.</p>
<p>The option was initially added for handling pathological cases,
such as joining too many strings using the addition operator, which
was leading pylint to have a recursion error when trying to figure
out what the string was. Unfortunately, we decided to ignore the
issue, since the pathological case would have happen when the
code was parsed by Python as well, without actually reaching the
runtime step and as such, we will remove the option in the future.</p>
</li>
<li><p class="first">The <code class="docutils literal"><span class="pre">check_docs</span></code> extension is now deprecated. The extension is still available
under the <code class="docutils literal"><span class="pre">docparams</span></code> name, so this should work:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span>$ pylint module_or_package --load-extensions=pylint.extensions.docparams
</pre></div>
</div>
<p>The old name is still kept for backward compatibility, but it will be
eventually removed.</p>
</li>
</ul>
</div>
<div class="section" id="removed-features">
<h2>Removed features<a class="headerlink" href="#removed-features" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>None yet</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">What’s New In Pylint 1.6</a><ul>
<li><a class="reference internal" href="#summary-release-highlights">Summary – Release highlights</a></li>
<li><a class="reference internal" href="#new-checkers">New checkers</a></li>
<li><a class="reference internal" href="#new-features">New features</a></li>
<li><a class="reference internal" href="#bug-fixes">Bug fixes</a></li>
<li><a class="reference internal" href="#other-changes">Other Changes</a></li>
<li><a class="reference internal" href="#deprecated-features">Deprecated features</a></li>
<li><a class="reference internal" href="#removed-features">Removed features</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">What’s New in Pylint</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="changelog.html"
title="next chapter">Pylint NEWS</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/whatsnew/1.6.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="changelog.html" title="Pylint NEWS"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="What’s New in Pylint"
>previous</a> |</li>
<li class="nav-item nav-item-0"><a href="../index.html">Pylint 1.6.5 documentation</a> »</li>
<li class="nav-item nav-item-1"><a href="index.html" >What’s New in Pylint</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2003-2017, Logilab.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
</div>
</body>
</html>
|