| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit 7de1f56047d5939f1d5670884160301792d1d51b.
pyenchant was using StopIteration explicitly so there's no need to replace that
with returns as it doesn't conflict with PEP 479. The original issue had a separate problem
that wasn't related to this checker.
|
|
|
|
| |
Thanks @antonenk. Close #2579
|
|
|
|
|
|
|
|
|
|
|
| |
corresponding Python identifiers
This is to prevent users having to think about escaping the default value for
``logging-format-style`` in the generated config file. Also our config parsing
utilities don't quite support escaped values when it comes to ``choices`` detection,
so this would have needed various hacks around that.
Close #2614
|
| |
|
| |
|
|
|
|
| |
- fix #2610 (#2611)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to this commit literal-comparison did not fire for the following
comparisons
x is 0
x is 1
due to a subtle bug in the checker implementation. The skip condition
in the ``ComparisonChecker._check_literal_comparison`` was
literal.value in (True, False, None)
which holds for True/False/None _as well as_ 0 and 1, since 0 == False
and 1 == True.
|
|
|
| |
As given, the install instructions gather a version of PyLint which does not support all the features of Python 3.6. For example, as of 11/3/2018, f-strings are not supported, and pyreverse3 will fail reporting a syntax error. After running upgrade as prescribed in the new instructions, this problem is solved.
|
| |
|
|
|
|
|
|
| |
iteration.
Close #2533
|
|
|
|
|
| |
``implicit-str-concat-in-sequence`` detects string concatenation inside lists, sets & tuples.
It would warn on code such as `('a', 'b' 'c')`.
|
|
|
|
|
|
|
|
| |
Makes some minor revisions & grammatical corrections to the docs. Some
notable items:
- tries to make references to PEP 8 consistent (rather than PEP-8, PEP 8,
PEP-08, etc)
- general typos
|
|
|
|
|
|
|
|
| |
logging-format-style accepts one of '%' or '{', (defaults to '%'). When '{' is selected, logging
checker assumes str.format() style format strings for calls to the logging.
pylint was unable to count the required number of args for the format string when the
format string was using the `{` format. The new feature indirectly fixes that by allowing
the proper interpretation of that format string.
|
|
|
|
|
|
|
| |
a dictionary
This inhibits the capability of the check of finding occurrences of these methods. There's a low
chance of having a false positive.
|
|
|
|
|
|
|
|
|
|
|
|
| |
deprecated method
Previously we were using the fully qualified name, which we still do, but the fully
qualified name for some ``unittest`` deprecated aliases leads to a generic
deprecation function. Instead on relying on that, we now also rely on the attribute
name, which should solve some false positives.
Close #1653
Close #1946
|
| |
|
|
|
|
| |
that error locally
|
|
|
|
| |
Close #2519
|
|
|
|
|
|
|
|
|
|
| |
https://github.com/python/cpython/commit/c4ef4896eac86a6759901c8546e26de4695a1389
(not yet in any released version, but it's been backported to all
versions of Python in git, even 2.7!) changed the behaviour in the
stdlib's tokenize module to emit a synthetic NEWLINE token even if the
file does not end with a newline. This was causing a spurious
"mixed-line-endings" warning to be emitted, but luckily the synthetic
token is easy to test for (the token text is "").
|
| |
|
|
|
|
|
|
|
|
| |
The regex was adapted so that we either stop at one of `;` or `#`, or at the end
of the line. This should improve the situation a little bit when dealing with the
flags of other linters.
Close #2485
|
|
|
|
| |
test for it in unittest_utils
|
| |
|
|
|
|
|
|
|
| |
Closes #1422
Closes #2019
This fixes #1422 and fixes #2019.
|
| |
|
|
|
|
|
|
| |
values, prefer boolyness instead
Close #2527
|
|
|
|
| |
#2226
|
| |
|
|
|
|
|
|
|
|
| |
pyenchant is no longer maintained and doesn't seem to install correctly on all systems.
But it is installable on Travis, so instead we separated that from the main test suite in order
to run it in its own step.
Close #1900
|
|
|
|
|
|
|
|
|
|
| |
It used to be a warning until a couple of years ago, after it was promoted to
an error. But the check might be suggesting the wrong thing in some cases,
for instance when checking against ``sys.argv`` which cannot be known at static
analysis time. Given it might rely on potential unknown data, it's best to
have it as a warning.
Close #2522
|
|
|
|
|
|
|
|
| |
On Debian, the binary `python` will always point to Python 2. When
building the documentation, there is no way to change the Python
interpreter to Python 3 on Debian.
Therefore allow specifying PYTHON to override the Python interpreter.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The following expression from test_good_comprehension_checks will fail
to execute, because the list element from the range function has the
type int and int has no len method:
```
>>> [data for data in range(100) if len(data)]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <listcomp>
TypeError: object of type 'int' has no len()
```
Use the built-in `abs` method instead of the `len` method to make the
test case a little bit more realistic.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Several files in pylint/test/functional have Windows newlines (CRLF)
instead of Unix newlines (LF). To list these files, run:
```
find . -type f -exec file "{}" ";" | grep CRLF
```
This commit corrects the line endings of the file that the following
commit will touch by running following command:
```
perl -pi -e 's/\r\n/\n/g' pylint/test/functional/using_constant_test.py
```
Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
|
| |
|
|
|
|
| |
targets
|
| |
|
| |
|
| |
|
|
|
| |
Close #2118
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
is per assignment elements
Nested assignment tuples can each have a single starred assignment, as in the
following example:
((a, *b), *c) = ...
The check was previously unflattening the occurrences of Starred nodes,
resulting in a total number of 2 Starred nodes for the given
assignment tuple, while in fact there is just one starred node
for the first tuple, followed by a separate second starred node.
Close #2513
|
|
|
|
|
|
| |
Don't suggest enumerate when defining `__iter__` and operating on the underlying class
Closes #2477
|
| |
|
|
|
|
|
|
| |
Similar to simplifiable-if-statement, it finds trivial ternary
statements and suggested replacing them.
Paired-with: Richard Goodman <richardg@brandwatch.com>
|