mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
Fix documentation typos (#527)
This commit is contained in:
parent
71b8002cca
commit
13485d3c2f
4 changed files with 6 additions and 6 deletions
|
|
@ -13,7 +13,7 @@ defining what attributes on a node matter when matching against predefined patte
|
|||
|
||||
To accomplish this, a matcher has been created which corresponds to each LibCST
|
||||
node documented in :ref:`libcst-nodes`. Matchers default each of their attributes
|
||||
to the special sentinal matcher :func:`~libcst.matchers.DoNotCare`. When constructing
|
||||
to the special sentinel matcher :func:`~libcst.matchers.DoNotCare`. When constructing
|
||||
a matcher, you can initialize the node with only the values of attributes that
|
||||
you are concerned with, leaving the rest of the attributes set to
|
||||
:func:`~libcst.matchers.DoNotCare` in order to skip comparing against them.
|
||||
|
|
@ -79,7 +79,7 @@ Traversal Order
|
|||
^^^^^^^^^^^^^^^
|
||||
|
||||
Visit and leave functions created using :func:`~libcst.matchers.visit` or
|
||||
:func:`~libcst.matchers.leave` follow the traveral order rules laid out in
|
||||
:func:`~libcst.matchers.leave` follow the traversal order rules laid out in
|
||||
LibCST's visitor :ref:`libcst-visitor-traversal` with one additional rule. Any
|
||||
visit function created using the :func:`~libcst.matchers.visit` decorator will be
|
||||
called **before** a ``visit_<Node>`` function if it is defined for your visitor.
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@
|
|||
"into your :ref:`libcst-visitors` in order to identify which nodes you care ",
|
||||
"about. Matcher :ref:`libcst-matcher-decorators` help reduce that boilerplate.\n",
|
||||
"\n",
|
||||
"Say you wanted to invert the the boolean literals in functions which ",
|
||||
"Say you wanted to invert the boolean literals in functions which ",
|
||||
"match the above ``best_is_call_with_booleans``. You could build something ",
|
||||
"that looks like the following:"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@
|
|||
" self.stack: List[Tuple[str, ...]] = []\n",
|
||||
" # store the annotations\n",
|
||||
" self.annotations: Dict[\n",
|
||||
" Tuple[str, ...], # key: tuple of cononical class/function name\n",
|
||||
" Tuple[str, ...], # key: tuple of canonical class/function name\n",
|
||||
" Tuple[cst.Parameters, Optional[cst.Annotation]], # value: (params, returns)\n",
|
||||
" ] = {}\n",
|
||||
"\n",
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
" self.stack: List[Tuple[str, ...]] = []\n",
|
||||
" # store the annotations\n",
|
||||
" self.annotations: Dict[\n",
|
||||
" Tuple[str, ...], # key: tuple of cononical class/function name\n",
|
||||
" Tuple[str, ...], # key: tuple of canonical class/function name\n",
|
||||
" Tuple[cst.Parameters, Optional[cst.Annotation]], # value: (params, returns)\n",
|
||||
" ] = annotations\n",
|
||||
"\n",
|
||||
|
|
|
|||
|
|
@ -1711,7 +1711,7 @@ def findall(
|
|||
or a :class:`OneOf`/:class:`AllOf` special matcher. Unlike :func:`matches`, it can
|
||||
also be a :class:`MatchIfTrue` or :func:`DoesNotMatch` matcher, since we are
|
||||
traversing the tree looking for matches. It cannot be a :class:`AtLeastN` or
|
||||
:class:`AtMostN` matcher because these types are wildcards which can only be usedi
|
||||
:class:`AtMostN` matcher because these types are wildcards which can only be used
|
||||
inside sequences.
|
||||
"""
|
||||
nodes, _ = _find_or_extract_all(tree, matcher, metadata_resolver=metadata_resolver)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue