Skip to content

Commit

Permalink
Add typos CI, fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Jul 17, 2024
1 parent 846c152 commit 9ddefd8
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ jobs:
pip install ruff
ruff check
typos:
name: Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/typos@v1

validate_cff:
name: Validate CITATION.cff
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions pytools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,7 @@ def memoize_method(
.. versionchanged:: 2021.2
Can memoize methods on classes that do not allow setting attributes
(e.g. by overwritting ``__setattr__``), e.g. frozen :mod:`dataclasses`.
(e.g. by overwriting ``__setattr__``), e.g. frozen :mod:`dataclasses`.
"""

return memoize_on_first_arg(method,
Expand Down Expand Up @@ -905,7 +905,7 @@ class keyed_memoize_method(keyed_memoize_on_first_arg): # noqa: N801
.. versionchanged:: 2021.2
Can memoize methods on classes that do not allow setting attributes
(e.g. by overwritting ``__setattr__``), e.g. frozen :mod:`dataclasses`.
(e.g. by overwriting ``__setattr__``), e.g. frozen :mod:`dataclasses`.
"""
def _default_cache_dict_name(self, function):
return intern(f"_memoize_dic_{function.__name__}")
Expand All @@ -931,7 +931,7 @@ class memoize_in: # noqa: N801
.. versionchanged:: 2021.2.1
Can now use instances of classes as *container* that do not allow
setting attributes (e.g. by overwritting ``__setattr__``),
setting attributes (e.g. by overwriting ``__setattr__``),
e.g. frozen :mod:`dataclasses`.
"""

Expand Down Expand Up @@ -2787,7 +2787,7 @@ def unordered_hash(hash_instance: Any,
*hash_constructor*, return a hash object whose internal state
depends on the entries of *iterable*, but not their order. If *hash*
is the instance returned by evaluating ``hash_constructor()``, then
the each entry *i* of the iterable must permit ``hash.upate(i)`` to
the each entry *i* of the iterable must permit ``hash.update(i)`` to
succeed. An example of *hash_constructor* is ``hashlib.sha256``
from :mod:`hashlib`. ``hash.digest_size`` must also be defined.
If *hash_constructor* is not provided, ``hash_instance.name`` is
Expand Down
4 changes: 2 additions & 2 deletions pytools/prefork.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""OpenMPI, once intialized, prohibits forking. This helper module
"""OpenMPI, once initialized, prohibits forking. This helper module
allows the forking of *one* helper child process before OpenMPI
initializaton that can do the forking for the fork-challenged
initialization that can do the forking for the fork-challenged
parent process.
Since none of this is MPI-specific, it got parked in pytools.
Expand Down
2 changes: 1 addition & 1 deletion pytools/py_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def __setstate__(self, obj):
# {{{ picklable function

class PicklableFunction:
"""Convience class wrapping a function in a :class:`PicklableModule`.
"""Convenience class wrapping a function in a :class:`PicklableModule`.
"""

def __init__(self, module, name):
Expand Down
2 changes: 1 addition & 1 deletion pytools/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class Taggable:
if not TYPE_CHECKING:
def __init__(self, tags: FrozenSet[Tag] = frozenset()):
warn("The Taggable constructor is deprecated. "
"Subclasses must declare their onwn storage for .tags. "
"Subclasses must declare their own storage for .tags. "
"The constructor will disappear in 2025.x.",
DeprecationWarning, stacklevel=2)

Expand Down
2 changes: 1 addition & 1 deletion pytools/test/test_persistent_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ def test_datetime_hashing() -> None:
assert (keyb(datetime.datetime(2020, 1, 1))
== keyb(datetime.datetime(2020, 1, 1))
== keyb(datetime.datetime(2020, 1, 1, 0, 0, 0, 0))
== "215dbe82add7a55c"
== "215dbe82add7a55c" # spellchecker: disable-line
)
assert keyb(datetime.datetime(2020, 1, 1)) != keyb(datetime.datetime(2020, 1, 2))
assert (keyb(datetime.datetime(2020, 1, 1))
Expand Down
4 changes: 4 additions & 0 deletions typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[default]
extend-ignore-re = [
"(?Rm)^.*(#|//)\\s*spellchecker:\\s*disable-line$"
]

0 comments on commit 9ddefd8

Please sign in to comment.