summaryrefslogtreecommitdiff
path: root/pylint/checkers/python3.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't include excepthandlers that don't have a name when looking for ↵Claudiu Popa2018-05-231-0/+3
| | | | exception-escape
* Rewrite the comprehension-escape and exception-escape to work only on the ↵Claudiu Popa2018-05-231-33/+56
| | | | | | | | | | | | | corresponding nodes These two checks were implemented in terms of visit_namne, that is, for every name in the tree, we looked to see if that name leaked. This was resulting in a couple of false positives and also in a performance issue, since we were calling nodes_of_class() and scope() for each name node. Instead, this approach uses the visit methods for exception and comprehension nodes and looks to see from there if the current scope uses leaked names. This is not the ideal situation as well, ideal would be to have access to the definition frame of each name, but that requires some extra engineering effort in astroid to get it right. Close #2106
* min() and max() accept iterators (#2138)Anthony Sottile2018-05-231-1/+2
|
* Use last previous assignment for comprehension-escape (#2131)Anthony Sottile2018-05-221-3/+4
|
* Refixed old-raise-syntax not looking for tracebackAshley Whetter2018-05-161-2/+1
|
* old-raise-syntax can be triggered only on Python 2Claudiu Popa2018-05-161-4/+6
| | | | Close #2107
* Fix lintClaudiu Popa2018-05-131-4/+6
|
* Reimplement the lookup() call by manually looking for the right nodesClaudiu Popa2018-05-131-13/+28
| | | | | | On Python 3 we can't see the assignment statement of a deleted node, such as an assignment from a loop or from the except handler. Instead of relying on lookup() itself, look through the current scope manually for the right objects.
* Added two new Python 3 porting checks, `exception-escape` and ↵Claudiu Popa2018-05-131-1/+27
| | | | | | | `comprehension-escape` These two are emitted whenever pylint detects that a variable defined in the said blocks is used outside of the given block. On Python 3 these values are deleted.
* Emit a warning when sys.exc_clear is accessedClaudiu Popa2018-05-111-0/+7
|
* Emit a warning when .xreadlines() is accessedClaudiu Popa2018-05-111-5/+13
|
* The Python 3 porting checker can run with Python 3 as wellClaudiu Popa2018-05-101-123/+61
|
* Handle dict subclasses for dict-not-iterating checksClaudiu Popa2018-04-181-7/+8
|
* defaultdict and subclasses of dict are now handled for dict-iter-* checksClaudiu Popa2018-04-181-2/+9
| | | | Close #2005
* Added a new Python 2/3 check for accessing removed urllib functionsClaudiu Popa2018-04-121-1/+19
| | | | Close #1997
* Added a new Python 2/3 check for accessing `operator.div`, which is removed ↵Claudiu Popa2018-04-121-0/+8
| | | | | | in Python 3 Close #1936
* Fix lint errorsClaudiu Popa2018-04-051-3/+3
|
* Catch string.letters with the Python 3 porting checkerClaudiu Popa2018-04-051-2/+2
| | | | Close #1935
* Add missing string functions to the Python 3 porting checkerClaudiu Popa2018-04-041-1/+3
|
* Fix lint errors caused by the new checker changeClaudiu Popa2018-04-021-7/+6
|
* Spelling fixesVille Skyttä2018-01-301-4/+4
|
* Rip some of the six imports from the codebaseClaudiu Popa2018-01-251-7/+4
|
* Split words that were inadvertently glued togetherJakub Wilk2018-01-211-1/+1
|
* fixes zip-builtin-not-iterating false positive when used as reversed ↵gaurikholkar2018-01-181-1/+1
| | | | function argument
* Regenerate copyright noticesClaudiu Popa2017-12-151-1/+15
|
* Do not warn no-absolute-import multiple times per file (#1725)Daniel Miller2017-11-111-1/+4
|
* Adding a check for ``inconsistent-return-statements`` inside function or ↵hippo912017-09-261-0/+2
| | | | | methods. (#1641) Close #1267
* A map enclosed by a filter call does not trigger map-builtin-not-iterating ↵Claudiu Popa2017-09-191-1/+1
| | | | on Python 3 porting checker any longer
* Adding a warning about keyword argument appearing before variable args list ↵ahirnish2017-09-151-0/+1
| | | | in the function definition (#1636)
* Add a couple of Uninferable filters where we weren't using anyClaudiu Popa2017-08-151-2/+5
|
* cProfile is not deprecated in Python 3 apparently. Close #1612Claudiu Popa2017-08-091-1/+1
|
* Fix a false positive with bad-python3-import on relative importsClaudiu Popa2017-08-071-1/+1
| | | | Close #1608
* Added a new Python 3 check, non-ascii-bytes-literals. Close #1545Claudiu Popa2017-07-231-0/+8
|
* Added a couple of new Python 3 checks for accessing dict methods in ↵Claudiu Popa2017-07-211-0/+28
| | | | non-iterable context. Part of #377
* Flag sets module as having moved in Python 3 (#1570)Roy Williams2017-07-111-2/+2
|
* Exempt exceptions with .message specifically implemented. Close #1564Claudiu Popa2017-07-081-2/+7
|
* Remove module that wasn't actually moved. Close #1565Claudiu Popa2017-07-081-1/+1
|
* Implement a Python3 warning for declaring a method `next` method that would ↵Roy Williams2017-06-021-5/+23
| | | | | | implement the Iterator protocol in Python 2 but not in Python 3. (#1509) In Python 2 implementing a no argument instance method `next` would implement the Iterator protocol, allowing the class to be used with `next()` or a `for` loop. In Python 3 this is now `__next__`.
* Add a warning for bad imports from the types module (#1501)Roy Williams2017-05-291-0/+14
|
* Add a warning for accessing itertools functions that have been removed. (#1500)Roy Williams2017-05-251-0/+7
|
* Python 3.6 invalid escape sequence deprecation fixes (#1396)Ville Skyttä2017-04-021-1/+1
| | | https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
* Respect checks for Python 2 (#1196)Roy Williams2017-01-031-2/+47
| | | | | | | | | | | | | | | | | | | | Frequently 2and3 code will gate some Python 3 specific code with something like: ```python if six.PY2: # something python 2 only ``` This PR will respect those branches. One thing I wasn't able to do was handle `else` branches here. e.g.: ```python if six.PY3: # something python 3 only else: # something python 2 only ```
* New refactoring checker: consider-using-ternary (#1210)Łukasz Rogalski2016-12-181-2/+3
| | | | | This check is emitted when pylint encounters constructs which were used to emulate ternary statement before it was introduced in Python 2.5. Close #1204
* Only check system modules during imports.Roy Williams2016-12-061-5/+8
| | | | | | | | | Without this change there could be a false-positive with the following code: ```python import six.moves.configparser configparser.ConfigParser() ```
* Add confidence to error messages about `str.translate` and ↵Roy Williams2016-12-051-8/+14
| | | | `str.encode/decode` (#1197)
* Add a Python 3 checker for finding deprecated calls to `str.translate`. (#1188)Roy Williams2016-12-051-2/+49
| | | | | | | | | | * Add a Python 3 checker for finding deprecated calls to `str.translate`. This checker could possibly have some false positives, but after checking our codebase and several other large codebases using this implementation, I did not find any false positives. * Add filter for types proven not to be strings
* Remove errant print statement. (#1186)Roy Williams2016-12-021-1/+0
|
* Add Python 3 checker for accessing deprecated functions on the `string` ↵Roy Williams2016-12-021-30/+66
| | | | | | module. (#1185) This also triggered a "Rule of 3" refactoring for me to generalize warning about accessing a given attribute on a module.
* Add a Python 3 Checker to find invalid imports in Python 3 (#1182)Roy Williams2016-11-301-4/+39
|
* Add a Python 3 warning about accessing sys.maxint (#1180)Roy Williams2016-11-291-3/+9
|