| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
The bug was introduced when porting the rule from pylint core to an extension
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
class. Closes #685.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
names and the name of the builtins module.
|
|
|
|
| |
related to issue #673
|
|
|
|
| |
related to issue #674
|
|
|
|
| |
related to issue #674
|
|
|
|
|
|
|
| |
- This way it works with embedded classes and functions
- Update the tests accordingly
related to issue #674
|
|
|
|
|
|
| |
for now
related to issue #674
|
|
|
|
|
|
| |
scope)
related to issue #674
|
|
|
|
|
| |
It is emitted when item deletion is tried on an object which doesn't
have this ability. Closes issue #592.
|
|
|
|
|
| |
This is emitted when item assignment is tried on an object which doesn't
have this ability. Closes issue #591.
|
| |
|
|
|
|
| |
related to issue #703
|
|
|
|
|
|
|
|
|
| |
The assumption that a module which can't be imported is local
rather than external isn't always correct, since the implementation
of the astroid's import system should always find a module
which is local in the current package, while it isn't necessary
true that it can find always external modules, which just might
be missing.
|
| |
|
| |
|
| |
|
|
|
|
| |
related to issue #692
|
|
|
|
| |
related to issue #692
|
|
|
|
| |
related to issue #692
|
|
|
|
| |
related to issue #692
|
|
|
|
| |
related to issue #692
|
|
|
|
|
|
| |
and comments)
related to issue #692
|
|
|
|
| |
related to issue #692
|
| |
|
| |
|
| |
|
|
|
|
|
| |
- move reverse_op declaration out of visit_unaryop
- build message out of operand, instead of using replace() on node.as_string()
|
|
|
|
|
| |
- warning => convention
- "One not too many" => "consider changing.."
|
| |
|
|
|
|
| |
Closes issue #651.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| |
| | |
error E0201 is obsolete - now E1101
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
--max-bool-expr option allows to configure it (by default, up to 5 are
tolerated)
closes issue #677
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
This way it won't infer all possibles values of a node, only two at most.
|
| |
| |
| |
| |
| | |
It returned erroneous number of comment lines.
tok_type is set just once, here one must look at the current token
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \ |
|
| | | |
|