A concrete syntax tree parser and serializer library for Python that preserves many aspects of Python's abstract syntax tree https://libcst.readthedocs.io/
Find a file
Jennifer Taylor bb72c70a3b Hand-roll print instead of using implicit repr, allowing us to filter
most irrelevant node attributes out.
2019-06-05 14:25:29 -07:00
libcst Hand-roll print instead of using implicit repr, allowing us to filter 2019-06-05 14:25:29 -07:00
stubs Initial export of LibCST to github. 2019-05-31 14:16:53 -07:00
.gitignore Initial export of LibCST to github. 2019-05-31 14:16:53 -07:00
LICENSE first commit 2019-05-29 11:32:49 -07:00
README.md Initial export of LibCST to github. 2019-05-31 14:16:53 -07:00
requirements.txt Initial export of LibCST to github. 2019-05-31 14:16:53 -07:00
setup.py Initial export of LibCST to github. 2019-05-31 14:16:53 -07:00

LibCST

TODO: Add documentation.

Auto-formatting code with isort and Black

We use isort and black to format code. To format changes to be conformant, run the following in the root:

isort -q -w 88 -m 3 -tc -fgw 0 -lai 2 -ca -ns __init__.py -y ; black --target-version py36 libcst/

Running tests

To run all tests, do the following in the root:

find -name "test_*.py" -printf '%P\n' | xargs python3 -m unittest

Verifying types with Pyre

To verify types for the library, do the following in the root:

pyre --source-directory . --search-path stubs/ check

Examining a sample tree

To examine the tree that is parsed from a particular file, do the following:

python -m libcst.tool print <some_py_file.py>