summaryrefslogtreecommitdiff
path: root/astroid/rebuilder.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove the # coding, since PEP3120 the default is UTF8Pierre Sassoulas2021-02-171-1/+0
|
* Update copyright noticehippo912021-02-151-1/+1
|
* Corrected the parent of function type comment nodesAshley Whetter2021-02-071-4/+4
| | | | | | | These nodes used to be parented to their original ast.FunctionDef parent but are now correctly parented to their astroid.FunctionDef parent. Closes #851
* Restructure the AST parsing heuristic to always pick the same moduleClaudiu Popa2020-04-291-70/+27
| | | | | | | | | | | | | | When a file contained a misplaced type annotation, we were retrying the parsing without type comments support. That second parsing was using the builtin ast module, but the rest of the tree utilities (the builder and rebuilder) were not aware of the new parsing module that was used to build the AST nodes a second time. This commit moves the logic of picking the parsing module and the corresponding AST node mapping in a single place, which can be used by both the builder and the rebuilder. Close PyCQA/pylint#3540 Close #773
* Add missing copyright annotations for the past releasesClaudiu Popa2020-04-271-1/+7
|
* Merge TreeRebuilder3 into TreeRebuilderClaudiu Popa2020-03-121-165/+111
| | | | | | | These were separated to allow us to add support for parsing Python 2 files as well as Python 3. Unfortunately that is no longer in our plans and since the code was already broken (e.g. the Raise node was receiving unexpected arguments), it's better to rip the bandaid and merge the two classes together.
* Revert the redefinition of type_comment_kwonlyargsClaudiu Popa2020-01-121-1/+0
|
* Make sure type_comment_kwonlyargs is set as wellClaudiu Popa2020-01-121-0/+1
|
* Fix unbound local error caused by 061aaebea2be2d21831ef687cc4ba4a25d953c65Claudiu Popa2020-01-121-0/+1
|
* Can access positional only and keyword only argument type commentsAshley Whetter2020-01-111-0/+10
|
* Spelling fixes (#706)Ville Skyttä2019-10-161-2/+2
|
* All type comments have as parent the corresponding `astroid` nodeClaudiu Popa2019-10-091-7/+9
| | | | | | | 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
* Remove redundant compatibility code (#693)Hugo van Kemenade2019-09-101-48/+29
|
* Introduce a new argument to `Arguments` for storing the positional only ↵Claudiu Popa2019-07-091-0/+7
| | | | | | | | | annotations The annotations were stored until now in `.annotations` and `kwonlyargs_annotations`, but given the addition of `posonlyargs`, we need to store the positional only annotations somewhere else as well. This new attribute should simplify the handling of annotations for both positional only and positional or keyword parameters.
* Add support for positional only arguments in astroid for python 3.8Claudiu Popa2019-07-091-0/+4
|
* Grab the Constant value on Python 3.8+Claudiu Popa2019-07-071-1/+2
|
* Grab only Constant strings for docstringsClaudiu Popa2019-07-061-12/+10
|
* Fix formattingClaudiu Popa2019-07-061-2/+4
|
* Fix finding of docstring under python3.8Zbigniew Jędrzejewski-Szmek2019-07-061-2/+4
| | | | | | | It is stored as a Constant, not a Str, so we the the value a bit differently. Fixes one test failure in https://github.com/gristlabs/asttokens/issues/28.
* Maintain the same line number for decorators for Python 3.8+Claudiu Popa2019-06-041-4/+8
|
* Set the line number of decorated functions for python 3.8Claudiu Popa2019-06-021-1/+15
| | | | | | | | | | Python 3.8 sets the line number of a decorated function to be the actual line number of the function, but the previous versions expected the decorator's line number instead. We reset the function's line number to that of the first decorator to maintain backward compatibility. It's not ideal but this discrepancy was baked into the framework for *years*.
* Add support for Python 3.8's `NamedExpr` nodes, which is part of assignment ↵Claudiu Popa2019-06-011-0/+7
| | | | | | expressions. Close #674
* Can access per argument type comments (#667)Ashley Whetter2019-05-141-0/+2
| | | Close #665
* Remove else after return/raiseTomas Gavenciak2018-12-111-1/+1
|
* Initial formatting of astroidClaudiu Popa2018-10-021-285/+354
|
* Reflect AST changes in Python 3.8.Serhiy Storchaka2018-09-301-0/+11
| | | | | | | | * 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)
* Spelling fixesVille Skyttä2018-07-241-3/+3
|
* Update the copyright noticesastroid-2.0Claudiu Popa2018-07-151-2/+12
|
* Fix useless-object-inheritance lint error (#573)Nick Drozd2018-06-281-1/+1
| | | See https://github.com/PyCQA/pylint/pull/2209
* Fix lintingClaudiu Popa2018-06-141-3/+3
|
* Remove useless TODOs that are either issues in the issue tracker or things ↵Claudiu Popa2018-06-121-1/+0
| | | | which we'll never get to fix/change
* Add support for parsing function type commentsClaudiu Popa2018-06-041-5/+32
| | | | | | 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.
* Add support for type comments (#548)Claudiu Popa2018-05-231-96/+148
|
* Get rid of the astpeephole (it's not an actual peephole and it's optimized ↵Claudiu Popa2018-05-131-19/+0
| | | | just for once single use case
* Module.__path__ is now a listClaudiu Popa2018-03-301-1/+2
| | | | | | | | | It used to be a string containing the path, but it doesn't reflect the situation on Python, where it is actually a list. Also fix a bug with namespace package's __path__ attribute, which wasn't using the module's __path__, but its file attribute, which is None for namespace packages. Close #528
* Fix lint errorsBryce Guinta2018-02-261-0/+1
|
* Fix lint errorsClaudiu Popa2018-02-041-2/+2
|
* Switch the order of the docstring checks to have the .docstring extractor firstClaudiu Popa2018-02-041-6/+6
|
* Use the .docstring attribute on Python 3.7 if it existsClaudiu Popa2018-02-041-1/+8
| | | | | This attribute contains now the actual docstring, it is not in the body of the function/class/node as it was until now.
* Drop support for EOL Python 3.3Hugo2017-12-151-7/+0
|
* Fix lint warningsClaudiu Popa2017-10-121-0/+1
|
* Arguments node gained a new attribute, kwonlyargs_annotations, for holding ↵Claudiu Popa2017-04-121-2/+16
| | | | the keyword-only args annotations
* Add support for asynchronous comprehensions (#400)Łukasz Rogalski2017-03-011-1/+2
| | | Closes #399
* Add support for Python 3.6's annotated assignment nodesrr-2017-02-091-1/+12
|
* Fix metaclass detection when multiple keyword arguments are used in ClassDef ↵Łukasz Rogalski2017-02-091-1/+1
| | | | (#402)
* Make ClassDefs support keyword arguments. (#384)Derek Gustafson2017-01-221-1/+3
|
* Remove occurrences of no-else-return and consider-using-ternaryClaudiu Popa2016-12-181-2/+2
|
* Remove pylint errorsDerek Gustafson2016-12-031-1/+1
|
* add format string support (#365)Jared Garst2016-10-241-0/+12
| | | Format strings require support for two new nodes, FormattedValue, respectively JoinedStr.
* Even more granular copyrights (thanks to copyrite)Claudiu Popa2016-07-221-2/+5
|