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 have a MVP for https://github.com/HypothesisWorks/hypothesis/issues/2705, but discovered that on Windows it can only format a single file at a time. The underlying problem is that `multiprocessing` on Windows works...
I've been looking at codemods and visitor examples but not finding a clear path to a solution. Any help would be appreciated. Assume I have already determined that a specific...
Example: ``` In [1]: code = '".".join(["a", "b"])' In [2]: import libcst as cst In [3]: from libcst import MetadataWrapper In [4]: wraper = MetadataWrapper(module=cst.parse_module(code)) In [5]: from libcst.metadata import...
## Issue 1. Call made to [TypeInferenceProvider.gen_cache()](https://github.com/Instagram/LibCST/blob/c023fa7c4caff3fd2b3946080f9a58b539b10363/libcst/metadata/type_inference_provider.py#L56) with a long list of paths for the `paths` argument. 2. Exception raised during the creation of `subprocess.Popen` [here](https://github.com/Instagram/LibCST/blob/c023fa7c4caff3fd2b3946080f9a58b539b10363/libcst/metadata/type_inference_provider.py#L105), where `command` argument is...
It seems as though instance variables are not included in the class scope, whereas class variables are. Example: ```python import libcst as cst source = """ class A: foo =...
Currently, it just ignores class attributes ``` class MyClass: name: str ``` `name: str` won't appear in the sources.
(copy of https://github.com/Instagram/MonkeyType/issues/199, with context of fairly major regression fixed in https://github.com/Instagram/LibCST/pull/314 / https://github.com/Instagram/MonkeyType/issues/198) Given the new importance of ApplyTypeAnnotationsVisitor to MonkeyType, we should try and improve test coverage of...
[What follows is probably heresy given that Pyre is another Instagram project, so please don't "throw me to the pyre" :fire: - I mean no offence to that project] I've...
When I tried running the convert_type_comments codemod on a nontrivial directory, I got thousands of this error: ``` Codemodding /path/to/some/python/file.py Traceback (most recent call last): File "/home/stroxler/kode/LibCST/libcst/codemod/_cli.py", line 288, in...
:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to [increase the usage of augmented assignment statements](https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements "Augmented assignment statements") accordingly....