LibCST
LibCST copied to clipboard
A concrete syntax tree parser and serializer library for Python that preserves many aspects of Python's abstract syntax tree
I noticed that `AnnAssign` allows for whitespace which includes newlines before or after the equals without a line continuation character. Is this expected? It seems when you construct other nodes,...
Following [PEP-614](https://www.python.org/dev/peps/pep-0614/), the follow code is valid in Python 3.9 and later: ```python @(lambda f: f) # or other expressions, e.g. `@buttons[0].clicked.connect` def valid_on_py39(): pass ``` but `libcst.parse_module()` raises ```python-traceback...
## Summary Using libCST cli tool allows to run a codemod over files inside a folder recursively. Context warning messages were not being cleaned between files, so warnings from one...
## Summary Documentation changes. ## Test Plan look at the generated docs
## Summary @data_provider seems unnecessary to include in libcst. Why not use a pypi equivalent. Here is an example using [parameterized](https://pypi.org/project/parameterized/) Let me know what you think and I'll convert...
At the moment sphinx 4.0.3 fails on building `LibCST` documentation so I've opened https://github.com/sphinx-doc/sphinx/issues/9432 however in that ticket there are some warnings as well ```console + /usr/bin/python3 setup.py build_sphinx -b...
## Summary As pointed out in #486, decorators are allowed to do more things. ## Test Plan Ran the tests. Why draft? [ ] unrelated test fixes for 3.9 [...
## Summary resolves #341 Adds `_PrecedenceNode` as a helper class to automatically parenthesize child nodes when necessary ## Test Plan Adds basic unit tests for implicit parens and extends fuzz...
## Summary This now parses a good amount of real-world `setup.py` code, and I've validated back to 2.3 (the earliest version I have handy). It passes most of [python-grammar-changes](https://github.com/thatch/python-grammar-changes) with...
## Summary This PR adds a `CSTTransformer` mixin that allows sub-classes to use `insert_statements_before_current` and `insert_statements_after_current`, as discussed in #263. For example, this transformer: ```python class InsertAssignAroundAssignVisitor(InsertStatementsVisitor): def leave_Integer( self,...