Fix documentation typos (#527)

This commit is contained in:
MapleCCC 2021-10-01 23:40:47 +08:00 committed by GitHub
parent 71b8002cca
commit 13485d3c2f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -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.

View file

@ -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:"
]

View file

@ -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",

View file

@ -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)