| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Simplify hard to maintain copyright notice
git is the source of truth for the copyright, copyrite (the tool)
was taking exponentially longer with each release, and it's
polluting the code with sometime as much as 50 lines of names.
* Add a pre-commit hook to check the copyright notice
* Fix the existing file so they have a notice
* Fix the spacing after the copyright notice
* Add a script to generate the CONTRIBUTORS.txt
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
|
|
|
|
|
|
|
| |
* Fix F403 wildcart import used in astroid/__init__.py
And apply flake8 on setup.py and astroid/__init__.py
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
|
| |
|
| |
|
|
|
| |
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* Fix link in license header
* Fix link to cpython
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Fix uncaught AstroidSyntaxErrors in namedtuple brain
Ref #920. This adds a test suite and updates the infer_named_tuple brain with
some additional behaviours expected by `collections.namedtuple`, specifically
about rejecting invalid type and field names. Some of these cases inferred as
namedtuples/`ClassDef` when they would have raised `ValueError` and some of
these raise unhandled `AstroidSyntaxError`s due to attempts to parse class
fakes with type names that would have raised `ValueError`. For example:
from collections import namedtuple
Tuple = namedtuple('X', 'abc abc')
# Traceback (most recent call last):
# ...
# ValueError: Encountered duplicate field name: 'abc'
import astroid
node = astroid.extract_node("""
from collections import namedtuple
Tuple = namedtuple('X', 'abc abc')
Tuple
""")
next(node.infer())
# <ClassDef.X l.3 at 0x...>
from collections import namedtuple
Tuple = namedtuple('123', 'abc')
# Traceback (most recent call last):
# ...
# ValueError: Type names and field names must be valid identifiers: '123'
import astroid
node = astroid.extract_node("""
from collections import namedtuple
Tuple = namedtuple('123', 'abc')
Tuple
""")
next(node.infer())
# Traceback (most recent call last):
# ...
# KeyError: (<function infer_named_tuple at 0x...>, <Call l.3 at 0x...>)
#
# During handling of the above exception, another exception occurred:
#
# Traceback (most recent call last):
# ...
# File "<unknown>", line 2
# class 123(tuple):
# ^
# SyntaxError: invalid syntax
#
# The above exception was the direct cause of the following exception:
#
# Traceback (most recent call last):
# ...
# astroid.exceptions.AstroidSyntaxError: Parsing Python code failed:
# invalid syntax (<unknown>, line 2)
|
|
|
|
| |
Remove outdated COPYING and rename COPYING.LESSER
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
napoleon extension
|
|
|
|
|
| |
Set predicates for transforms which use inference_tips to prevent
a node's _explicit_inference from being overwritten
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
hierarchy can't be determined
It used to return Uninferable, but no call site was actually taking care of this
potential return. It is better though to simply raise an exception and to let
the call sites to handle them in which way they want to.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
import is trying to access something beyond the top-level package.
|
|
|
|
| |
The first name will exist until astroid 2.0.
|
|
|
|
|
|
|
|
| |
They are subclasses of AstroidBuildingException and are raised when
a module can't be imported from various reasons.
Also do_import_module lets the errors to bubble up without converting
them to InferenceError. This particular conversion happens only
during the inference.
|
|\ |
|