summaryrefslogtreecommitdiff
path: root/pylint/checkers/classes.py
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
| * check for class methods declared without a decoratorLaura Médioni2015-10-291-3/+36
| | | | | | | | related to the issue #675
* | Make iterable checker skip classes that are inferred to be abstractDmitry Pribysh2015-10-271-10/+1
|/ | | | | --HG-- branch : fix-685
* non-iterator-returned can detect classes with iterator-metaclasses.Claudiu Popa2015-10-201-11/+27
| | | | Closes issue #679.
* Rename checking function for 'super()' call checking and update Changelog.Dmitry Pribysh2015-10-181-2/+2
| | | | | --HG-- branch : fix-667
* Make `no-self-use` checker not throw a warning if method has a `super()` call.Dmitry Pribysh2015-10-171-1/+10
| | | | | | | | | | This is only enabled for python 3.0+ and only for `super` calls with no arguments. Fixes issue #667. --HG-- branch : fix-667
* Don't emit 'assigning-non-slot' for descriptors. Closes issue #652.Claudiu Popa2015-10-041-0/+23
|
* Use the new node names for the visit and leave methodsClaudiu Popa2015-08-261-7/+7
| | | | | Also, emit a PendingDeprecationWarning if the old names are still used, this support being removed in pylint 2.0.
* Update pylint to use the new astroid AST names and methodsClaudiu Popa2015-08-251-30/+28
| | | | | | | Also improve a couple of imports and added support for the old visit_ names. Priority will have the old visit_ names, such as visit_discard over visit_expr, visit_callfunc over visit_call etc.
* Don't emit no-init if not all the bases from a class are known.Claudiu Popa2015-07-221-1/+1
| | | | Closes issue #604.
* Use safe_infer and has_known_bases from astroid.helpers. Closes issue #593.Claudiu Popa2015-07-061-3/+4
|
* Detect a couple of objects which can't be base classes (bool, slice, range ↵Claudiu Popa2015-06-251-1/+8
| | | | and memoryview, which weren't detected until now).
* Fix a false positive regarding staticmethods: they don't have an implicit ↵Claudiu Popa2015-06-151-2/+1
| | | | argument when 'bounded'.
* Remove trailing whitespace.Claudiu Popa2015-06-141-3/+3
|
* arguments-differ understand differences between various type of functions.Claudiu Popa2015-06-141-6/+32
| | | | | This patch improves the way how arguments-differ understands the differences between classmethods, staticmethods and properties. Closes issue #548.
* Pylint understand super calls.Claudiu Popa2015-05-281-0/+3
|
* Fix some pylint warnings over pylint's codebase.Claudiu Popa2015-05-161-3/+3
|
* Remove trailing whitespaces.Claudiu Popa2015-05-141-3/+3
|
* Remove 'bad-context-manager' due to the inclusion of ↵Claudiu Popa2015-05-141-19/+2
| | | | 'unexpected-special-method-signature'.
* Add a new warning 'unexpected-special-method-signature'.Claudiu Popa2015-05-141-3/+58
| | | | | This is emitted when a special method (dunder method) doesn't have the expected signature, which can lead to actual errors in the application code. Closes issue #253.
* Don't emit attribute-defined-outside-init and ↵Claudiu Popa2015-05-121-1/+9
| | | | | | | | access-member-before-definition for mixin classes. Actual errors can occur in mixin classes, but this is controlled by the ignore-mixin-members option, so if something is a legitimate error, then the user can pass --ignore-mixin-members=no in order to check these in mixin classes as well. Closes issue #412.
* Cleanup.Claudiu Popa2015-05-111-6/+6
|
* Move non-iterator-returned to a new checker, SpecialMethodsChecker, which ↵Claudiu Popa2015-05-101-26/+46
| | | | has checks for structural checking of special methods.