Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Allow statements in if or try blocks containing imports. | Laura M?dioni | 2015-12-02 | 2 | -5/+17 |
| | | | | Closes issue #714 | ||||
* | Added a new error, 'relative-beyond-top-level'. | Claudiu Popa | 2015-12-06 | 3 | -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 Popa | 2015-12-06 | 2 | -2/+2 |
| | | | | AstroidSyntaxError. | ||||
* | Don't emit super-on-old-class on classes with unknown bases. | Claudiu Popa | 2015-12-06 | 2 | -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 Popa | 2015-12-03 | 1 | -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 Popa | 2015-12-02 | 1 | -0/+1 |
| | |||||
* | Try to register the else-if checker explicitly instead on relying on path ↵ | Claudiu Popa | 2015-12-02 | 1 | -4/+2 |
| | | | | assumptions. | ||||
* | Don't emit import-self and cyclic-import for relative imports of modules ↵ | Claudiu Popa | 2015-12-01 | 4 | -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 checker | Claudiu Popa | 2015-12-01 | 3 | -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 test | Laura M?dioni | 2015-11-30 | 2 | -0/+75 |
| | |||||
* | Fix a crash which occurred when old visit methods are encountered | Claudiu Popa | 2015-11-30 | 1 | -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 Popa | 2015-11-30 | 1 | -0/+25 |
| | | | | class. Closes #685. | ||||
* | Add wrong-import-position to check_messages's decorator arguments for ↵ | Claudiu Popa | 2015-11-30 | 3 | -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 rule | Laura M?dioni | 2015-11-24 | 1 | -3/+3 |
| | | | | related to issue #674 | ||||
* | Use a stack of dictionaries instead of 3 dicts | Laura M?dioni | 2015-11-24 | 2 | -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?dioni | 2015-11-24 | 2 | -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?dioni | 2015-10-30 | 6 | -4/+60 |
| | | | | | | scope) related to issue #674 | ||||
* | Added a new warning, 'unsupported-delete-operation' | Claudiu Popa | 2015-11-26 | 2 | -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 Popa | 2015-11-26 | 2 | -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 rule | Laura M?dioni | 2015-11-25 | 1 | -0/+4 |
| | | | | related to issue #703 | ||||
* | Fix some docstrings and the Python 3 tests | Claudiu Popa | 2015-11-25 | 4 | -5/+5 |
| | |||||
* | Fix new import related errors in pylint's codebase. | Claudiu Popa | 2015-11-25 | 4 | -5/+3 |
| | |||||
* | slightly change wrong-import-position message and add forgotten functional test | Laura M?dioni | 2015-11-12 | 2 | -0/+24 |
| | | | | related to issue #692 | ||||
* | Check imports are located at the top of the module (right after docstring ↵ | Laura M?dioni | 2015-11-10 | 39 | -61/+65 |
| | | | | | | and comments) related to issue #692 | ||||
* | Check imports are ordered (standard, 3rd party, local) and grouped by package | Laura M?dioni | 2015-11-09 | 12 | -8/+48 |
| | | | | related to issue #692 | ||||
* | Add is to the checked operators | Laura M?dioni | 2015-11-24 | 2 | -0/+3 |
| | |||||
* | Fix crash with 'in' operator on unneeded-not | Laura M?dioni | 2015-10-29 | 2 | -1/+6 |
| | |||||
* | improve unneeded-not messages | Laura M?dioni | 2015-10-27 | 1 | -12/+12 |
| | | | | | - warning => convention - "One not too many" => "consider changing.." | ||||
* | Check for nots too many in comparison expressions | Laura M?dioni | 2015-10-26 | 3 | -1/+54 |
| | |||||
* | Ignore missing docstrings for decorated attribute setters and deleters | Michael Kefeder | 2015-11-19 | 1 | -0/+19 |
| | | | | Closes issue #651. | ||||
* | Added a new refactoring warning, 'simplifiable-if-statement' | Claudiu Popa | 2015-11-21 | 2 | -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 reasonnable | Laura M?dioni | 2015-10-29 | 2 | -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 checker | Dmitry Pribysh | 2015-11-09 | 4 | -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 checker | Dmitry Pribysh | 2015-11-07 | 2 | -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 Popa | 2015-11-04 | 1 | -1/+1 |
| | |||||
* | Add test for deques to `unsubscriptable-object` functional tests | Dmitry Pribysh | 2015-11-04 | 1 | -0/+6 |
| | |||||
* | Merged in lmedioni/pylint (pull request #298) | Claudiu Popa | 2015-11-04 | 2 | -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 high | Laura M?dioni | 2015-10-30 | 2 | -0/+97 |
| | | | | | | | | related to issue #668 | ||||
* | | Rename 'unsubscriptable-value' message to 'unsubscriptable-object' | Dmitry Pribysh | 2015-11-03 | 2 | -28/+28 |
| | | |||||
* | | Add checker for unsubscriptable values used in subscript expression. | Dmitry Pribysh | 2015-11-03 | 3 | -1/+99 |
|/ | | | | Fixes issue #561. | ||||
* | Fix the tests to work on both Python versions. | Claudiu Popa | 2015-10-30 | 2 | -2/+2 |
| | |||||
* | Merged in lmedioni/pylint (pull request #295) | Claudiu Popa | 2015-10-30 | 11 | -4/+88 |
|\ | | | | | | | check for class methods declared without a decorator | ||||
| * | no-static/class-method: enhance the tests and fix the code accordingly | Laura M?dioni | 2015-10-29 | 4 | -3/+21 |
| | | |||||
| * | improve style and fix typos regarding no_class/staticmethod_decorator | Laura M?dioni | 2015-10-29 | 2 | -2/+2 |
| | | |||||
| * | check for static methods declared without a decorator | Laura M?dioni | 2015-10-29 | 5 | -3/+32 |
| | | | | | | | | closes issue #675 | ||||
| * | check for class methods declared without a decorator | Laura M?dioni | 2015-10-29 | 8 | -3/+40 |
| | | | | | | | | related to the issue #675 | ||||
* | | Add a few functional tests for enhanced unpacking checkerenhance-unpacking-checker | Dmitry Pribysh | 2015-10-29 | 2 | -13/+36 |
| | | |||||
* | | Merge heads. | Claudiu Popa | 2015-10-27 | 2 | -0/+44 |
|\ \ | |||||
| * | | Add a new convention message, 'consider-using-enumerate' | Claudiu Popa | 2015-10-27 | 2 | -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-685 | Dmitry Pribysh | 2015-10-27 | 4 | -13/+105 |
| | |