Hunter Hogan
aa53960458
Fix typos in tutorial.ipynb ( #1378 )
2025-07-15 20:22:23 +01:00
Zsolt Dollenstein
42df0881ba
Fix doc build error ( #1221 )
...
Apparently doc2path now returns a path not a string
2024-10-10 11:20:25 +01:00
Wim Jeantine-Glenn
0974a416a7
Typo fix in codemods_tutorial.rst (trivial) ( #1208 )
2024-09-18 09:23:30 +01:00
Kirill Ignatev
72701e4b40
Mention codemod -x flag in docs ( #1169 )
2024-07-04 07:49:15 +01:00
zaicruvoir1rominet
6bbc69316b
Add the ability to dump CST to .dot (graphviz) files ( #1147 )
...
* Make the nodes fields filtering process - from libcst.tool - public, so that other libraries may provide their own custom representation of LibCST graphs.
* Create functions to access & filter CST-node fields (with appropriate docstrings & tests), in libcst.helpers
* Add new CST-node fields functions to helpers documentation.
2024-05-20 11:25:13 -04:00
zaicruvoir1rominet
efc53af608
Add helper functions for common ways of filtering nodes ( #1137 )
...
* Make the nodes fields filtering process - from libcst.tool - public, so that other libraries may provide their own custom representation of LibCST graphs.
* Create functions to access & filter CST-node fields (with appropriate docstrings & tests), in libcst.helpers
* Add new CST-node fields functions to helpers documentation.
2024-05-13 10:20:47 +01:00
Sebastián Ramírez
0713a35548
Fix typo in docs/source/scope_tutorial.ipynb ( #1135 )
...
* ✏️ Fix typo in `docs/source/scope_tutorial.ipynb`
* ✏️ Fix another typo
* ✏️ Fix typos
* ✏️ Fix typos
2024-05-03 22:27:37 +01:00
Sebastián Ramírez
e9dc135ae4
Fix tiny typo in docs/source/metadata.rst ( #1134 )
...
* ✏️ Fix typo in metadata.rst
* ✏️ Fix typo
2024-05-03 22:27:20 +01:00
Sergii Dymchenko
0d087acdf6
Typo fix FullRepoManager ( #1138 )
2024-05-03 22:25:37 +01:00
Marcelo Trylesinski
f1b973f6b3
Fix pyre setup link in metadata.rst ( #913 )
2023-04-25 09:45:51 +01:00
Amethyst Reese
c876db6d2d
Add new FilePathProvider
...
Caches file path information on the root `Module` node.
Resolves paths when caching, so they are always absolute paths.
Adds a new `chdir` helper to change working directory and automatically
revert to previous directory, which makes testing file paths with the
`"."` repo root easier.
ghstack-source-id: 3413905fc1
Pull Request resolved: https://github.com/Instagram/LibCST/pull/892
2023-03-13 18:33:46 -07:00
MapleCCC
79cf251896
Update Sphinx to 5.1.1 ( #748 )
2022-08-17 13:55:06 +01:00
zzl
84da283604
Fix code example in metadata documentation. ( #703 )
...
Co-authored-by: zzl0 <zhuzhaolong0@mail.com>
2022-06-16 09:49:24 +01:00
Zsolt Dollenstein
c44ff0500b
Fix license headers ( #560 )
...
* Facebook -> Meta
* remove year from doc copyright
2021-12-28 11:55:18 +00:00
MapleCCC
13485d3c2f
Fix documentation typos ( #527 )
2021-10-01 16:40:47 +01:00
Zsolt Dollenstein
45c0d96c06
master -> main ( #521 )
2021-09-07 11:59:38 +01:00
Steven Troxler
5e1e3fe970
The ufmt tool combines usort and black with a consistent wrapper, ( #515 )
...
which ensures we won't have inconsistent black-vs-isort errors
going forward. We can always format by running `ufmt format .`
at the root, and check with `ufmt check .` in our CI actions.
2021-08-25 20:39:29 -04:00
Zach Hammer
c7f2f577ac
Docs: fix typo ( #492 )
...
Caught this while quoting your docs in a blog post, which I'll share once published :)
2021-07-28 09:53:50 +01:00
Zsolt Dollenstein
1bd1c0890c
Add FullyQualifiedNameProvider ( #465 )
2021-03-26 17:15:57 +00:00
Luke Petre
4ab866e40f
Add BuiltinScope ( #469 )
...
* Add more builtin tests
* Introduce a BuiltinScope that sits above GlobalScope
* Address comments and fix lint
* Updating documentation
* Update scope illustration
* Add BuiltinScope to libcst.metadata
* Lazily create builtin assignments, update scope diagram
2021-03-24 12:12:56 -07:00
Caleb Donovick
0ee0831eb6
Add FlattenSentinel to support replacing a statement with multiple statements ( #455 )
...
* Add flatten_sentinal
* Add FlattenSentinal to __all__
* Fix lint errors
* Fix type errors
* Update test to use leave_Return
* Update and run codegen
* Add empty test
* Update docs
* autofix
2021-03-22 23:23:40 -07:00
Batuhan Taskaya
6ae25834bb
Implement TypeOf matcher ( #384 )
...
* Implement TypeOf matcher
* Satisfy the type checker
* Expand the test case
* Fix the annotation of _raw_options
* Add documentation...
2020-09-10 11:09:59 -07:00
Jimmy Lai
748ae71909
[docs] add source code links to each class/function ( #378 )
2020-08-20 17:15:21 -07:00
Jimmy Lai
2e788a25dc
[doc] use cst node in ensure_type in best practice doc ( #361 )
2020-08-05 12:57:37 -07:00
Zsolt Dollenstein
6a5e7394c0
[RemoveUnusedImports] Support string type annotations ( #353 )
...
* [RemoveUnusedImports] Support string type annotations
This PR adds support for detecting imports being used by string type
annotations, as well as imports suppressed by comments.
It breaks up the existing visitor into multiple smaller, single-purpose
visitors, and composes them together.
2020-07-31 15:54:39 +01:00
jimmylai
c023fa7c4c
[typing] enable Pyre strict mode by default ( #313 )
...
Co-authored-by: Jimmy Lai <jimmylai@fb.com>
2020-06-12 18:24:18 -07:00
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
Zsolt Dollenstein
477a03e3a8
[ScopeProvider] Expose more granular Assignments and Accesses for dotted imports ( #284 )
2020-04-21 10:27:47 +01:00
jkarres
621d9a949a
typo fix
2020-04-05 10:50:10 -07:00
Pradeep Kumar Srinivasan
1b9a52b074
Apply annotations from stub.
...
Basically move the apply_annotations code from Pyre.
Make it a ContextAwareTransformer named ApplyTypeAnnotationsVisitor. Use GatherImportsVisitor to collect imports. Add a static method `add_stub_to_context` so that users can schedule a stub whose types are to be applied later. Use `assertCodemod` and `data_provider` in the tests. Add documentation. Remove fixmes.
2020-03-23 09:16:37 -07:00
Tim Hatch
ef56771900
Add comment to docs
2020-03-05 07:00:24 -08:00
Zsolt Dollenstein
bd31d3feac
add docs and expose provider in libcst.metadata
2020-02-28 09:28:11 -08:00
Jennifer Taylor
0ff9a6c5b7
Add a visitor which can remove unused imports using scope analysis.
2020-02-18 16:02:10 -08:00
Jennifer Taylor
8479513e8f
Add a visitor that can gather exports specified in the __all__ module identifier.
2020-02-18 16:02:10 -08:00
Jimmy Lai
abd37df6b6
[doc] add get_full_name_for_node_or_raise
2020-02-12 12:03:57 -08:00
Jennifer Taylor
63f7c5a5d8
Fix typing issue with subscript elements where visitors of Index and Slice could not return each other.
2020-02-03 10:30:29 -08:00
Jimmy Lai
7b474703a0
[doc] fix indentation
2020-01-29 05:25:30 +08:00
Jennifer Taylor
e48aa6eaf7
Implement basic templated statement/expression/module parsing.
...
This has some corner cases that we do not currently handle, but those will come in a later commit.
2020-01-23 10:17:47 -08:00
Jennifer Taylor
fdd5cbbfe6
Implement parsing of posonly param indicator ('/'). This brings us to full 3.8 compatibility.
2020-01-17 10:57:48 -08:00
Jennifer Taylor
6eb6ec7b1d
Add posonly parameter support to Parameters node.
...
This is part one of a two-part change to support the posonly param indicator "/".
2020-01-15 11:18:12 -08:00
Jimmy Lai
0d01792e6d
expose all helpers in libcst.helpers for convenience
2020-01-14 15:11:48 -08:00
Jimmy Lai
257fd5755e
move ensure_future to libcst.helpers.expression
2020-01-10 12:15:38 -08:00
Jimmy Lai
dffb27b5b9
add get_full_name_for_expression helper
2020-01-10 12:15:38 -08:00
Jennifer Taylor
92050fac39
Fix a few typos in docs.
2020-01-08 18:08:30 -08:00
Jennifer Taylor
3ca41ffabc
Remove deprecated position provider objects.
2020-01-08 17:19:03 -08:00
Jennifer Taylor
40e19ac457
Remove deprecated ExtSlice.
2020-01-08 17:18:19 -08:00
Jennifer Taylor
b319312de3
Add docstring for CodemodTest.
2020-01-08 17:17:48 -08:00
Jimmy Lai
3c4c282bbe
add documents for TypeInferenceProvider and FullRepoManager
2019-12-28 20:51:29 -08:00
Jennifer Taylor
9bfc4faea9
Add documentation for libcst.codemod and friends.
2019-12-17 11:59:51 -08:00
Jennifer Taylor
e4457425aa
Implement a replace function.
...
This takes a tree, a matcher, and a replacement, replacing all nodes in the tree
which match the shape of the matcher with the replacement.
2019-12-05 14:11:22 -08:00