summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Try to update pypy to 3.6.1Claudiu Popa2020-03-031-1/+1
|
* Better inference of class and static methods decorated with custom methodsClaudiu Popa2020-03-033-0/+97
| | | | Close PyCQA/pylint#3209
* Wrap coverage in quotesClaudiu Popa2020-03-021-1/+1
|
* Force coverage<5 in travis just like in toxClaudiu Popa2020-03-021-1/+1
|
* Pass a context to Arguments.call_site() callsClaudiu Popa2020-03-024-9/+9
|
* Pass a context argument to ``astroid.Arguments`` to prevent recursion errorsClaudiu Popa2020-03-024-14/+44
| | | | Close PyCQA/pylint#3414
* Infer qualified ``classmethod`` as a classmethod. (#759)Claudiu Popa2020-02-273-5/+40
| | | Close PyCQA/pylint#3417
* Relax upper bound on `wrapt` (#756)Michael2020-02-273-2/+6
| | | Closes PyCQA/astroid#755
* Cleanup travis config (#757)Michael2020-02-271-5/+1
|
* numpy.astype now returns a ndarray objecthippo912020-02-103-1/+36
| | | | | | | This fixes PyCQA/pylint#3332. The bug was due to the fact that datetime64 class inherited from generic one and in this last class the astype method was returning uninferable. Now it returns ndarray object. This fix should be generalized to all other methods of the generic class as the numpy doc specifies that the generic object API should be the same as the ndarray one.
* Skip non ``Assign`` and ``AnnAssign`` nodes from enum reinterpretationClaudiu Popa2020-02-103-0/+21
| | | | Closes PyCQA/pylint#3365
* Don't crash upon invalid contex on attr. inference (#746)Leandro T. C. Melo2020-02-101-0/+2
|
* Make imag and real attributes numpy.ndarrayhippo912020-02-103-2/+37
| | | Close PyCQA/pylint#3322
* Revert the redefinition of type_comment_kwonlyargsClaudiu Popa2020-01-121-1/+0
|
* Make sure type_comment_kwonlyargs is set as wellClaudiu Popa2020-01-121-0/+1
|
* Fix unbound local error caused by 061aaebea2be2d21831ef687cc4ba4a25d953c65Claudiu Popa2020-01-122-1/+2
|
* Can access positional only and keyword only argument type commentsAshley Whetter2020-01-114-0/+89
|
* Return a stub module instead of an import error for frozen modulesAshley Whetter2020-01-111-0/+2
|
* Use the parent of the node when inferring aug assign nodes instead of the ↵Claudiu Popa2020-01-053-3/+25
| | | | | | | | | | | | | statement In 19b5af02304e3339fdd2a26cfafc337960eeebce we added a check for `AugAssign` nodes when inferring `Assign` values. Unfortunately the `infer_assign` function was also used by `infer_assignname`, which meant that when trying to infer an `AssignName` node, we were inferring its value as the result of the `AugAssign` inference, leading to spurious false positives. Close PyCQA/pylint#2911 Close PyCQA/pylint#3214
* Add input param to subprocess.check_output. Close PyCQA/pylint#3317Claudiu Popa2020-01-051-0/+2
|
* Add a call to register_transform for each numpy function in case the current ↵hippo912020-01-053-2/+21
| | | | | | | | | | | | node is an astroid.Name instance The problem was that astroid could not infer the result of a call to `numpy.append` because this function calls the `concatenate` function. This last function is inferred thanks to the `brain_numpy_core_multiarray` module but only when the corresponding node is an `astroid.Attribute` (for example numpy.concatenate). It turns out that in the source of the append function the node that realises the call to concatenate is a `astroid.Name`. Thus the correction proposed here is to register the concatenate inference tip function in order to apply it, also, to `astroid.Name`. Close #666
* Add the float_power function in the brain and in its associated testhippo912019-12-303-0/+16
| | | | | | | | The bug PyCQA/pylint#3319 was caused due to a missing function, named float_power inside the brain_numpy_core_umath module. This brain is used to infer all the numpy's ufunc functions. The problem is that in the website documentation of numpy, in the section that list all those functions, there is not entry dealing with the float_power function. Also adds 5 missing functions detected by @texadactyl Closes PyCQA/pylint#3319
* 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