summaryrefslogtreecommitdiff
path: root/pylint/checkers/classes.py
Commit message (Collapse)AuthorAgeFilesLines
...
* useless-super-delegation takes into account default values for the current ↵hippo912017-09-301-0/+96
| | | | | implementation A method can reimplement a super method in order to provide a different default value, in which case we shouldn't emit ``useless-super-delegation``.
* Skip the invalid-length-returned check when the return value is clearly an ↵Claudiu Popa2017-09-291-1/+8
| | | | int, but with an uninferable underlying value
* Adding a check for ``inconsistent-return-statements`` inside function or ↵hippo912017-09-261-4/+4
| | | | | methods. (#1641) Close #1267
* Add a couple of Uninferable filters where we weren't using anyClaudiu Popa2017-08-151-2/+2
|
* Fix line-too-longClaudiu Popa2017-06-031-1/+2
|
* Don't emit assigning-non-slot when reassigning the class with another class ↵Claudiu Popa2017-06-021-0/+12
| | | | that has the same layout. Close #1506
* Remove mentions of deprecated astroid node names (#1485)Łukasz Rogalski2017-05-221-4/+4
|
* Do not emit warning on type(self)._private_attribute access (#1288)Łukasz Rogalski2017-02-051-7/+26
| | | Closes #1031
* Change the text of arguments-differ by making it more explicitClaudiu Popa2016-12-301-1/+1
|
* Take in consideration the dummy-rgx-variable when checking for different ↵Claudiu Popa2016-12-301-16/+32
| | | | parameters. Close #1041
* Fix formatting and use any() to simplify the checkClaudiu Popa2016-12-181-12/+22
|
* Add new checker len-as-condition (#1154)Alexander Todorov2016-11-291-1/+1
| | | | | | * Add new checker len-as-condition * Fix len(SEQUENCE) warnings discovered by new checker
* Report when __slots__ is a simple string and not a non-string container (#1171)Anthony Foglia2016-11-241-0/+5
| | | | | | * Report when __slots__ is a simple string and not a non-string container * Update ChangeLog
* Don't try to access variables defined in a separate scope when checking for ↵Claudiu Popa2016-11-201-7/+26
| | | | protected-access. Close #1126
* Grammar fixClaudiu Popa2016-07-231-1/+1
|
* Exempt special methods from arguments-differ. Close #1042Claudiu Popa2016-07-231-1/+7
|
* Do not emit useless-super-delegation when having extraneous arguments in the ↵Claudiu Popa2016-07-231-1/+25
| | | | call site. Close #1043
* Use ClassDef.instantiate_class() (#1040)Florian Bruhin2016-07-231-1/+1
| | | | | | | | Otherwise we get this from astroid: .../pylint/pylint/checkers/classes.py:1112: PendingDeprecationWarning: ClassDef.instanciate_class() is deprecated and slated for removal in astroid 2.0, use ClassDef.instantiate_class() instead. instance = cls.instanciate_class()
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-231-2/+8
|
* Keep a consistent copyright notice across the board.Claudiu Popa2016-07-191-0/+2
| | | | | This was changed automatically in #894, but apparently we need to have the copyright notice somewhere.
* Do not check for useless-super-delegation if the function is decoratedMoises Lopez - https://www.vauxoo.com/2016-07-171-0/+4
|
* Uninferable now has a false default value, so don't check it explicitly.Claudiu Popa2016-07-161-1/+1
|
* Add a new warning, 'useless-super-delegation'Claudiu Popa2016-07-151-1/+135
| | | | | | | | | | This is used whenever pylint can detect than an overridden method is useless, relying on super() delegation to implement the same thing as another method from MRO. In this case, it is enough to not implement the given method and let it be propagated to the another implementation from the MRO. Close #839
* arguments-differ takes in consideration kwonlyargs and variadicsClaudiu Popa2016-07-101-6/+16
| | | | | | | | | | | | | | | | | | | | The check was rewritten to be more strict about overridding a method: - now it complains if the parent method had variadics in the signature, but the overridden method does not have. For instance, having *args in the parent method means that it can accept anything, but restricting this to (a, b) in the overridden method leads to inconsistencies in their behavior and can potentially introduce new bugs. - it complains if the number of keyword only parameters are not the same in the overridden method - it complains about the names of the parameters. For instance, having (a, b) in the parent method and changing this to (c, d) in the overridden method means that the latter one cannot be accessed in the same way as the parent method, when using keyword arguments. Close #983
* Do not complain about arguments-differ if the overridden method has variadic ↵Claudiu Popa2016-07-101-0/+4
| | | | positional arguments.
* Check the names of the parameters when checking for overridden methods with ↵Claudiu Popa2016-07-101-10/+36
| | | | different parameters
* Fix bad indentation.Claudiu Popa2016-07-061-2/+1
|
* Remove features which were scheduled for removal.Claudiu Popa2016-07-061-7/+2
|
* Add the new shorter license header, including to missing files. Close #894.Claudiu Popa2016-06-011-15/+3
|
* Fix typos (#916)Jakub Wilk2016-05-251-2/+2
| | | | | | | | * Split words that were inadvertently glued together * Fix typos in the documentation * Fix typos in message descriptions
* Don't crash when checking, for super-init-not-called, a method defined in an ↵Claudiu Popa2016-05-101-1/+2
| | | | if block.
* Filter non Const nodes instead of checking for AttributeError.Claudiu Popa2016-03-161-6/+8
|
* New check: invalid-length-returnedŁukasz Rogalski2016-03-141-1/+18
| | | | Implementation of issue #557.
* remove @check_message decorator from [visit|leave]_classdef methods of the ↵Sylvain Thenault2016-01-191-7/+0
| | | | | | | | | | | ClassChecker Those methods are actually not only emitting the listed messages but also updating some internal state that is used from other, unrestricted, messages. We should work on separating responsabilities if we want to restrict method entries upon messages restriction. Closes issue #789
* Catch more cases as not proper iterables for __slots__Claudiu Popa2016-01-181-9/+4
| | | | Close issue #775
* Add new missing messages from check_messages decorator.Claudiu Popa2016-01-151-1/+3
|
* Mark missing messages with check_messages.Claudiu Popa2016-01-151-2/+3
|
* Treat AsyncFunctionDef just like FunctionDef nodesClaudiu Popa2016-01-091-0/+4
| | | | | | | | | When support for Python 3.5 was added, AsyncFunctionDef wasn't handled properly in terms of FunctionDef, which meant that most of the checks which involved a function were never called for AsyncFunctionDef. This led to spurious false positives which occurred when AsyncFunctionDef were analyzed. Closes #767
* Fix new import related errors in pylint's codebase.Claudiu Popa2015-11-251-2/+3
|
* Fix instances of unneeded-not in pylint's codebase.Claudiu Popa2015-11-251-1/+1
|
* Cleanup pylint issuesClaudiu Popa2015-11-211-9/+6
| | | | | | | | | | | This changeset also brings a couple of changes: * rrheaders and rcheaders are dropped from html_writer.Table's constructor. They weren't used at all and it was dead code. This simplified some if statements. * _is_attribute_property is used to look for a property assignment instead on relying on a different implementation.
* Import has_known_bases and safe_infer back into pylint from astroid, until ↵Claudiu Popa2015-11-201-5/+5
| | | | | | | | | the latter stabilizes its API. Currently astroid goes into a total revamp, having a couple of development branches with partially incompatible APIs, which means that pylint can't rely on the exact location of has_known_bases and safe_infer until astroid reaches a new major release. With this in mind, these two functions are backported in pylint again.
* Refactor non-iterator-returned checker to use safe inferenceDmitry Pribysh2015-11-091-8/+24
| | | | This way it won't infer all possibles values of a node, only two at most.
* Reduce number of false positives emitted by non-iterator-returned checkerDmitry Pribysh2015-11-071-4/+7
| | | | | | | | By disabling checker for cases when there're multiple possible values infered for node. This way we lose some of the inference power, but throw a lot less false positives. Fixes issue #695.
* Separe the conditions to improve the readability of the code.Claudiu Popa2015-10-301-0/+4
|
* Prefer any instead of for.Claudiu Popa2015-10-301-4/+3
|
* Merged in lmedioni/pylint (pull request #295)Claudiu Popa2015-10-301-3/+43
|\ | | | | | | check for class methods declared without a decorator
| * no-static/class-method: enhance the tests and fix the code accordinglyLaura Médioni2015-10-291-4/+3
| |
| * improve style and fix typos regarding no_class/staticmethod_decoratorLaura Médioni2015-10-291-2/+3
| |
| * check for static methods declared without a decoratorLaura Médioni2015-10-291-5/+12
| | | | | | | | closes issue #675