| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Until now they had as parent the builtin `ast` node which meant
we were operating with primitive objects instead of our own.
Close PyCQA/pylint#3174
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
expressions.
Close #674
|
|
|
| |
Close #665
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* Num, Str, Bytes, Ellipsis and NameConstant are replaced with Constant.
(https://bugs.python.org/issue32892)
* Index is replaced with its value, ExtSlice is replaced with Tuple.
(https://bugs.python.org/issue34822)
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When a f-string contained a complex expression, such as an attribute access,
we weren't cloning all the subtree of the f-string expression for attaching the correct
line number. This problem is coming from the builtin AST parser which gives for the f-string
and for its underlying elements the line number 1, but this is causing all sorts of bugs and
problems in pylint, which expects correct line numbering.
Close PyCQA/pylint#2449
|
|
|
|
| |
call result.
|
|
|
|
| |
Close PyCQA/pylint#2400
|
| |
|
|
|
|
| |
Close #596
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The precedence and associativity rules of operators are respected
and parens are only wrapped around child nodes when needed
A single If node inside the else block is output as `elif`
Unneccesary parens in with statements are removed
Unneccesary parens in tuple returns are removed
Doc strings in classes and functions no longer get additional indenting
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Calling object.__new__ on a Const node would result in infinite recursion
Fix infinite recursion by explicitly raising AttributeError if
__getattr__ is called for value
See https://nedbatchelder.com/blog/201010/surprising_getattr_recursion.html
for more details
Close #565
|
| |
|
|
|
|
|
|
| |
This commit exposes two new attributes to the FunctionDef nodes, type_comment_args
respectively type_comment_annotations. These two attributes hold the type annotations
provided via type comments.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This allows .root().name calls to work for Unknown objects
Close #523
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Since we don't understand descriptors at all, we're relying
on a list of possible property-descriptors, that is, decorators
which transforms a method into its value, the exact process that
a property does. While this is a bad approach, it works, at least
until we can provide support for this high level of understanding.
Closes #279
|
|
|
|
|
|
|
|
|
|
| |
Some of the messages were disabled in pylintrc, since they're not
very useful for our case. Other parameters, such as the number of
arguments / statements / attributes etc were configured so that they
won't be too restrictive for our codebase, since making the code
to respect them right now requires too much development changes,
which is not justified by the end result.
Closes issue #284.
|
|
|
|
|
|
|
|
| |
Previously, we were enabling blindly all the warnings in
tests files through `warnings.simplefilter`, which had the side effect
of not taking into account the values of the -W flag. This meant
that warnings which should have been silenced, weren't, leading to
a huge output when running the tests with Python 3.5.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
node was used.
The possible values for the contexts are `Load` ('a'), `Del` ('del a'),
`Store` ('a = 4') and the nodes that got the new attribute are Starred,
Subscript, List and Tuple. The builtin ast module provides contexts for
Name and Attribute as well, but we took a different approach in the past,
by having different nodes for each type of context. For instance, Name
used in a Del context is a DelName, while Name used in a Store
context is AssignName. Since this is ingrained in astroid since quite
some time, it makes no sense to change them as well, even though it's
a loss of consistency.
The patch introduces a new dependency to enum34 on older Python
versions, which is used for building the three possible enum values
for the contexts.
Closes issue #267.
|
|
|
|
| |
The first name will exist until astroid 2.0.
|
|
|
|
|
|
|
|
|
|
| |
Some object, for instance List or Tuple can have, after inference,
Uninferable as their elements, happening when their components
weren't couldn't be inferred properly. This means that as_string
needs to cope with expecting Uninferable nodes part of the other
nodes coming for a string transformation. The patch adds a visit
method in AsString and ``accept`` on Yes / Uninferable nodes.
Closes issue #270.
|