summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add an entrybug_666hippo912019-12-271-0/+5
|
* Reformatting according to blackhippo912019-12-274-14/+28
|
* Add commentshippo912019-12-272-1/+7
|
* Enrichmet of thz assertion failure messagehippo912019-12-271-1/+1
|
* Fixing the test about numpy multiply function which call is infered as a ↵hippo912019-12-271-3/+4
| | | | pair (ndarray, Uninferable)
* Infer the call to sum results in a pair Uninferable, ndarrayhippo912019-12-271-8/+7
|
* Add the test of functions add and multiplyhippo912019-12-271-0/+2
|
* Interact a minimum with the inference engine.hippo912019-12-271-13/+17
| | | | No need to mock the sum function. Just inform the engine that the out parameter in the sum function is an array.
* Adds two missing ufunc instances (add and multiply)hippo912019-12-271-0/+2
|
* Adds a call to register_transform for each function in case the current node ↵hippo912019-12-261-0/+5
| | | | is an astroid.Name instance
* The method looks_like_numpy_member is able to deal with astroid.Name nodeshippo912019-12-261-4/+8
|
* Enable duplicate-code checkNick Drozd2019-12-241-2/+0
|
* Enable wrong-import-order, wrong-import-position checksNick Drozd2019-12-242-3/+1
|
* Enable else-if-used extensionNick Drozd2019-12-243-16/+16
|
* Add missing methods of the numpy.core.multiarray module.hippo912019-12-243-7/+154
| | | Closes PyCQA/pylint#3208
* Make use of cache while transform builtin containersStanislav Levin2019-12-232-3/+20
| | | | | | | | | | | | | | | As of now, the transformation of builtin containers which members, in turn, are containers relies on `safe_infer` helper. `safe_infer` tries to infer the node to get its values. Doing this without a cache containing a previously inferred nodes lead to infinite recursion, for example, on resolving a class attribute. Note: this doesn't help to infer a class attribute by itself is such a case, but prevents crash. Closes: https://github.com/PyCQA/pylint/issues/3245 Signed-off-by: Stanislav Levin <slev@altlinux.org>
* Rename variable to not shadow builtinClaudiu Popa2019-12-161-3/+3
|
* Pin coverage to <5 to account for the private coverage format changingClaudiu Popa2019-12-161-3/+3
|
* Allow inferring attributes of `HTTPStatus` callableClaudiu Popa2019-12-162-0/+19
| | | | Close PyCQA/pylint#3296
* Set arguments on inferred properties and property descriptors such as fget()Claudiu Popa2019-12-152-1/+4
|
* ``nodes.Const.itered`` returns a list of ``Const`` nodes, not stringsClaudiu Popa2019-12-154-4/+19
| | | | | | | Because ``Const.itered`` was not returning proper nodes, pylint was failing when trying to infer objects created from those nodes. Close PyCQA/pylint#3306
* Handle StopIteration error in infer_int.David Liu2019-12-093-1/+23
| | | | | | | | | | | This fixes https://github.com/PyCQA/pylint/issues/3274. Prior to Python 3.7, StopIteration errors bubbled up through generators, so this wasn't an issue for astroid because the StopIteration error was handled later. Now StopIteration errors are converted to RuntimeErrors [1], so the same error handling doesn't work. [1]: https://www.python.org/dev/peps/pep-0479/
* Reformatting according to blackhippo912019-12-091-15/+39
|
* Corrects links toward issueshippo912019-12-091-2/+2
|
* Adds two entries dealing with numpyhippo912019-12-091-0/+10
|
* Reactivates tests for functions whose result is inferred as an ndarray and ↵hippo912019-12-092-16/+16
| | | | uninferable.
* Ufunc objects are no more functions but instances a fake Ufunc classhippo912019-12-091-1/+1
|
* Adds unittest for ufunc objects returning pair of ndarrayhippo912019-12-091-2/+33
|
* Adds a special Ufunc class for ufunc objects that return pair of ndarrayhippo912019-12-091-6/+6
|
* Takes into account the fact thathippo912019-12-092-36/+16
| | | | | ufunc functions are now instances of FakeUfunc class and that the call to these functions implies the use of __call__ protocol.
* geterrobj et seterrobj are not ufunc objectshippo912019-12-091-8/+4
|
* The ufunc functions are now instance s of FakeUfunc class that mimics the ↵hippo912019-12-091-71/+107
| | | | behavior of ufunc numpy objects
* The shape attribute is an numpy.ndarrayhippo912019-12-091-1/+1
|
* Add support for inferring propertiesClaudiu Popa2019-12-0411-22/+233
| | | | | These new capabilities will allow inferring both the `property` builtin as well as property attributes such as `.deleter` and `.setter`.
* brain_gi: Don't ignore special methodsPhilipp Hörist2019-12-042-1/+35
| | | | | Ignoring all special methods while inspecting gi classes leads to pylint not detecting that objects are e.g. iterable or subscriptable
* Disable test on Python 3.8+ where the builtin ast does not have a specific errorClaudiu Popa2019-11-261-0/+8
|
* Retry parsing a module that has invalid type commentsClaudiu Popa2019-11-264-6/+60
| | | | | | | | It is possible for a module to use comments that might be interpreted as type comments by the `ast` library. We do not want to completely crash on those invalid type comments. Close #708
* Avoid a call to `getcwd` if it is not neededRaphael Gaschignard2019-11-261-2/+3
| | | When profiling locally, approximately 7% of a full pylint run is spent in `os.getcwd`, despite its value effectively not being used if `context_file` is `None`. A quick grep over this project and others seem to indicate that `context_file` is rarely used, so this should almost entirely get rid of this system call.
* Scope the inference to the current bound node when inferring instances of ↵Claudiu Popa2019-11-253-0/+65
| | | | | | | | | | | | | classes When inferring instances of classes from arguments, such as ``self`` in a bound method, we could use as a hint the context's ``boundnode``, which indicates the instance from which the inference originated. As an example, a subclass that uses a parent's method which returns ``self``, will override the ``self`` to point to it instead of pointing to the parent class. Close PyCQA/pylint#3157
* Allow attribute assignment for exception instancesClaudiu Popa2019-11-172-3/+28
|
* Add support for inferring exception instances in all contextsClaudiu Popa2019-11-175-15/+38
| | | | | | | | | | | We were able to infer exception instances as ``ExceptionInstance`` only for a handful of cases, but not all. ``ExceptionInstance`` has support for better inference of `.args` and other exception related attributes that normal instances do not have. This additional support should remove certain false positives related to ``.args`` and other exception attributes in ``pylint``. Close PyCQA/pylint#2333
* Add more supported parameters to ``subprocess.check_output``Claudiu Popa2019-11-172-2/+14
| | | | Close #722
* Add a ChangeLog entry for the proposed changeEnji Cooper2019-11-161-0/+6
| | | | Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Make installing pytest-runner contingent on running testsEnji Cooper2019-11-161-1/+5
| | | | | | | | This monkeypatches several changes from [PyCQA/mccabe](https://github.com/PyCQA/mccabe/blob/master/setup.py) over to the pylint repo, since the pattern was equivalent between the two projects. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Fix fixable pylint warningsEnji Cooper2019-11-161-5/+4
| | | | | | | | | | * Sort imports. * Remove squelching of W0704, since recent versions of pylint do not support the warning, resulting in an error with `pylint -E`. * Add `pylint: disable=unused-import` to seemingly unused imports which actually affect build behavior. Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
* Infer args unpacking of ``self``Claudiu Popa2019-11-143-0/+32
| | | | | | | | | | Certain stdlib modules use ``*args`` to encapsulate the ``self`` parameter, which results in uninferable instances given we rely on the presence of the ``self`` argument to figure out the instance where we should be setting attributes. Close PyCQA/pylint#3216
* Allow inferring positional only arguments on Python 3.8Claudiu Popa2019-11-146-12/+43
|
* Don't set a parent for descriptor bound methods created on `__get__` accessClaudiu Popa2019-11-081-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very tricky bug and requires particular circumstances to reproduce. For `f.__get__` we have a custom binding interface that generates bound methods on the fly whenever we encounter an `f.__get__(None, ...)` call. On function creation, we set the name of the function as a variable in the frame of the function's parent. e.g. for the following, we'll set `variable` as a name in the function's locals: class A: ... def variable(self): # variable will be part of A.locals pass Now the bug that this commit solves requires a `__get__()` binding such as the one mentioned as well as passing an object's dunder attribute to `__get__`, such as `object.__eq__`. The result is that the `None` that was passed in `f.__get__` will have as a frame the function where the descriptor binding method was called, which will result in `__eq__` to be marked as a variable of the function that was called, which is completely wrong. As a solution we don't set any parent for descriptor bound methods, which are created on the fly and thus the parent might be wrong altogether. Close PyCQA/pylint#3225
* Add brain for "responses" (#717)Stefan Scherfke2019-11-062-0/+75
| | | | Fixes: #716
* Update six version to 1.13 (#719)Uilian Ries2019-11-062-2/+2
| | | | Signed-off-by: Uilian Ries <uilianries@gmail.com>