summaryrefslogtreecommitdiff
path: root/pylint/test
Commit message (Collapse)AuthorAgeFilesLines
* Allow statements in if or try blocks containing imports.Laura M?dioni2015-12-022-5/+17
| | | | Closes issue #714
* Added a new error, 'relative-beyond-top-level'.Claudiu Popa2015-12-063-1/+28
| | | | | | | This is emitted when a relative import was attempted beyond the top level package. For instance, if a package has X levels, trying to climb X + n levels with a relative import, as in `from ..stuff import Stuff`, will result in an error. Closes issue #588.
* Make pylint work with new astroid exceptions, AstroidImportError and ↵Claudiu Popa2015-12-062-2/+2
| | | | AstroidSyntaxError.
* Don't emit super-on-old-class on classes with unknown bases.Claudiu Popa2015-12-062-14/+15
| | | | | | The change also removes the confidence handling for super-on-old-class, which isn't used enough to merit its existence. Closes issue #721.
* Accept only functions and methods for the deprecated-method checker.Claudiu Popa2015-12-031-0/+65
| | | | | This prevents a crash which can occur when an object doesn't have .qname() method after the inference.
* Disable persistence for test_self.Claudiu Popa2015-12-021-0/+1
|
* Try to register the else-if checker explicitly instead on relying on path ↵Claudiu Popa2015-12-021-4/+2
| | | | assumptions.
* Don't emit import-self and cyclic-import for relative imports of modules ↵Claudiu Popa2015-12-014-1/+15
| | | | | | | | | | | | | | | | | with the same name as the package itself. The problem was partially the fault of astroid.modutils.get_module_part, in combination with a given context file. The function returned 'dummy' as the module part for the string `dummy.dummy.Dummy`, which is in fact true, since the first dummy is the package and the second dummy is the module from where Dummy gets loaded. But get_module_part has no way to know this semantic inference, that the second dummy is a relative import inside the first one. As such, it's better to just skip the check if the condition of being relative inside a __init__.py file is found, since there's no way to load itself in that case. Closes issues #708 and #706.
* Refactor things through the imports checkerClaudiu Popa2015-12-013-2/+12
| | | | | | | | This patch transforms some public functions / methods to private and moves some blocks of code into their own functions. Through the latter, a couple of new messages are now emitted even though the module couldn't be imported, such as reimported, which doesn't make sense to not emit in this case.
* Add else-if-used rule functional testLaura M?dioni2015-11-302-0/+75
|
* Fix a crash which occurred when old visit methods are encounteredClaudiu Popa2015-11-301-1/+18
| | | | | | | | | | in plugin modules. If a plugin uses an old visit method (visit_class for instance), this can lead to a crash in pylint's base checkers, because the logic in the PylintASTWalker assumes that all checkers have a visit_class / leave_class method. The patch fixes this by looking for both names. Closes issue #711.
* Don't emit unsubscriptable-object if the node is found inside an abstract ↵Claudiu Popa2015-11-301-0/+25
| | | | class. Closes #685.
* Add wrong-import-position to check_messages's decorator arguments for ↵Claudiu Popa2015-11-303-1/+36
| | | | | | | | | | ImportChecker.leave_module This fixes an esoteric bug which occurs when ungrouped-imports and wrong-import-order are disabled and pylint is executed on multiple files. What happens is that without wrong-import-position in check_messages, leave_module will never be called, which means that the first non-import node from other files might leak into the current file, leading to wrong-import-position being emitted by pylint.
* Add some more comments about the limitations of this ruleLaura M?dioni2015-11-241-3/+3
| | | | related to issue #674
* Use a stack of dictionaries instead of 3 dictsLaura M?dioni2015-11-242-6/+17
| | | | | | | - This way it works with embedded classes and functions - Update the tests accordingly related to issue #674
* Remove test on str.split() since there is no support for inference on split ↵Laura M?dioni2015-11-242-11/+5
| | | | | | for now related to issue #674
* check if the type of a variable is redefined (at a function, class or module ↵Laura M?dioni2015-10-306-4/+60
| | | | | | scope) related to issue #674
* Added a new warning, 'unsupported-delete-operation'Claudiu Popa2015-11-262-0/+111
| | | | | It is emitted when item deletion is tried on an object which doesn't have this ability. Closes issue #592.
* Added a new warning, 'unsupported-assignment-operation'Claudiu Popa2015-11-262-0/+111
| | | | | This is emitted when item assignment is tried on an object which doesn't have this ability. Closes issue #591.
* Ignore multiple comparisons in unneeded-not ruleLaura M?dioni2015-11-251-0/+4
| | | | related to issue #703
* Fix some docstrings and the Python 3 testsClaudiu Popa2015-11-254-5/+5
|
* Fix new import related errors in pylint's codebase.Claudiu Popa2015-11-254-5/+3
|
* slightly change wrong-import-position message and add forgotten functional testLaura M?dioni2015-11-122-0/+24
| | | | related to issue #692
* Check imports are located at the top of the module (right after docstring ↵Laura M?dioni2015-11-1039-61/+65
| | | | | | and comments) related to issue #692
* Check imports are ordered (standard, 3rd party, local) and grouped by packageLaura M?dioni2015-11-0912-8/+48
| | | | related to issue #692
* Add is to the checked operatorsLaura M?dioni2015-11-242-0/+3
|
* Fix crash with 'in' operator on unneeded-notLaura M?dioni2015-10-292-1/+6
|
* improve unneeded-not messagesLaura M?dioni2015-10-271-12/+12
| | | | | - warning => convention - "One not too many" => "consider changing.."
* Check for nots too many in comparison expressionsLaura M?dioni2015-10-263-1/+54
|
* Ignore missing docstrings for decorated attribute setters and deletersMichael Kefeder2015-11-191-0/+19
| | | | Closes issue #651.
* Added a new refactoring warning, 'simplifiable-if-statement'Claudiu Popa2015-11-212-0/+124
| | | | | | | | | | | | | | This is used when an if statement could be reduced to a boolean evaluation of its test, as seen in this example: if some_cond: return True else: return False could be reduced to `return bool(some_cond)` Closes issue #698.
* check the number of boolean expressions in if statement is reasonnableLaura M?dioni2015-10-292-0/+24
| | | | | | | --max-bool-expr option allows to configure it (by default, up to 5 are tolerated) closes issue #677
* Use safe inference in unpacking-non-sequence checkerDmitry Pribysh2015-11-094-26/+34
| | | | | | | | | | | | | | | | Unfortunately, this fix means that we won't be able to emit an error for cases like this one: ``` def foo(): if True: return [1, 2] return [3, 4, 5] a, b = foo() ``` Well, not unless we get flow-sensitive inference. But we still need this fix to reduce the number of false-positive errors. Fixes issue #695.
* Reduce number of false positives emitted by non-iterator-returned checkerDmitry Pribysh2015-11-072-13/+17
| | | | | | | | 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.
* Fix the test to work on both Python versions.Claudiu Popa2015-11-041-1/+1
|
* Add test for deques to `unsubscriptable-object` functional testsDmitry Pribysh2015-11-041-0/+6
|
* Merged in lmedioni/pylint (pull request #298)Claudiu Popa2015-11-042-0/+97
|\ | | | | | | check if the number of nested block in a function or a method isn't too high
| * check if the number of nested block in a function or a method isn't too highLaura M?dioni2015-10-302-0/+97
| | | | | | | | related to issue #668
* | Rename 'unsubscriptable-value' message to 'unsubscriptable-object'Dmitry Pribysh2015-11-032-28/+28
| |
* | Add checker for unsubscriptable values used in subscript expression.Dmitry Pribysh2015-11-033-1/+99
|/ | | | Fixes issue #561.
* Fix the tests to work on both Python versions.Claudiu Popa2015-10-302-2/+2
|
* Merged in lmedioni/pylint (pull request #295)Claudiu Popa2015-10-3011-4/+88
|\ | | | | | | check for class methods declared without a decorator
| * no-static/class-method: enhance the tests and fix the code accordinglyLaura M?dioni2015-10-294-3/+21
| |
| * improve style and fix typos regarding no_class/staticmethod_decoratorLaura M?dioni2015-10-292-2/+2
| |
| * check for static methods declared without a decoratorLaura M?dioni2015-10-295-3/+32
| | | | | | | | closes issue #675
| * check for class methods declared without a decoratorLaura M?dioni2015-10-298-3/+40
| | | | | | | | related to the issue #675
* | Add a few functional tests for enhanced unpacking checkerenhance-unpacking-checkerDmitry Pribysh2015-10-292-13/+36
| |
* | Merge heads.Claudiu Popa2015-10-272-0/+44
|\ \
| * | Add a new convention message, 'consider-using-enumerate'Claudiu Popa2015-10-272-0/+44
| |/ | | | | | | | | | | The message is emitted when code that uses `range` and `len` for iterating is encountered, which can be easily simplified by using `enumerate` instead. This makes the code a bit faster and cleaner. Closes issue #684.
* | Make iterable checker skip classes that are inferred to be abstractfix-685Dmitry Pribysh2015-10-274-13/+105
| |