Commit graph

17 commits

Author SHA1 Message Date
Josie Eshkenazi
ed1a2ad4d1
Add fb open source required links (#307)
Links to Privacy Policy and Terms of Use in README.rst and docs/index
2020-06-04 14:27:54 -04:00
Jimmy Lai
dffb27b5b9 add get_full_name_for_expression helper 2020-01-10 12:15:38 -08:00
Jennifer Taylor
9bfc4faea9 Add documentation for libcst.codemod and friends. 2019-12-17 11:59:51 -08:00
Benjamin Woodruff
88ac18872c Add a reentrant (incremental) codegen API
**Context:** This is an experimental performance optimization that we're
hoping to use for our internal linter at Instagram. I added some
documentation, but it's unsupported, and isn't very user-friendly.

This adds `ExperimentalReentrantCodegenProvider`, which tracks the
codegen's internal state (indentation level, character offsets,
encoding, etc.) and for each statement, it stores a `CodegenPartial`
object.

The `CodegenPartial` object has enough information about the previous
codegen pass to run the codegen on part of a tree and patch the result
back into the original module's string.

In cases where we need to generate a bunch of small independent patches
for the same file (and we can't just generate a new tree with each patch
applied), this *should* be a faster alternative.

I don't have any performance numbers because I still need to test this
end-to-end with our internal codebase, but I'd be shocked if it was
slower than what we're doing.

This could theoretically live outside of LibCST, but it depends on a
whole bunch of LibCST internals, so there's some value in making sure
that this is in sync with the rest of LibCST.
2019-10-28 17:23:26 -07:00
Jennifer Taylor
ff65afaa26 Add a best practices section with various recommended practices.
There are going to be many more where this comes from, but these are the three cases that have come up most frequently, so I started with these. Hopefully this helps give additional direction to people using LibCST.
2019-10-23 16:50:47 -07:00
Jimmy Lai
b690c591e5 [doc] add Scope Analysis tutorial 2019-10-08 15:48:59 -07:00
Jimmy Lai
7b96b070ca Organize document menu as three parts: introduction, tutorial and reference 2019-10-02 12:26:35 -07:00
Jennifer Taylor
32037efab9 Add a tutorial for matchers. 2019-10-01 15:28:58 -07:00
Jennifer Taylor
e2868f703b Add documentation to matchers. 2019-10-01 15:28:58 -07:00
Ray Zeng
e2f2eafc59 Add extended example for metadata and fix some docstrings 2019-08-16 10:34:30 -07:00
Ray Zeng
79f0ebc2a4 Add sphinx docs to metadata modules 2019-08-16 10:34:30 -07:00
jimmylai
6138e74542
[document] add jupyter based tutorial page
* [document] add jupyter based tutorial page

* add return type and fix typos
2019-08-06 16:34:03 -07:00
Jennifer Taylor
8d000ababc Add a motivation section for LibCST documentation. 2019-08-01 14:51:00 -07:00
Benjamin Woodruff
c0ac3d7049 Switch from automodule to autoclass everywhere
- Now that we're exporting everything from the top-level libcst package,
  automodule makes a mess of things.
- While it does create more boilerplate, using autoclass/autofunction
  instead of automodule gives us a lot more control over the order in
  which nodes are presented, so we can group them by various categories.

This diff also exports BaseParenthesizableWhitespace, because nodes
refer to it by type, and so it's needed for documentation purposes.
2019-07-29 10:51:59 -07:00
jimmylai
14ee31dc6a [doc] Why libcst?
* reuse README intro section in doc

* [doc] Why LibCST?

* reuse README intro section in doc

* [doc] Why LibCST?
2019-07-24 12:19:00 -07:00
jimmylai
c0764745fa reuse README intro section in doc 2019-07-23 18:57:47 -07:00
jimmylai
120cfa9229 add sphinx autodoc templates and docs CI job 2019-07-22 20:05:27 -07:00