diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 46245d5a..21e28d7a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,14 +23,13 @@ repos: # - id: check-added-large-files # - id: detect-private-key -# todo: another great hook -# - repo: https://github.com/crate-ci/typos -# rev: v1.16.26 -# hooks: -# - id: typos -# # empty to do not write fixes -# args: [] -# exclude: pyproject.toml + - repo: https://github.com/crate-ci/typos + rev: v1.16.26 + hooks: + - id: typos + # empty to do not write fixes + args: [] + exclude: versioneer.py # - repo: https://github.com/PyCQA/docformatter # rev: v1.7.5 diff --git a/README.rst b/README.rst index a48816a8..c6fec439 100644 --- a/README.rst +++ b/README.rst @@ -12,7 +12,7 @@ Persistent, stale-free, local and cross-machine caching for Python functions. @cachier(stale_after=datetime.timedelta(days=3)) def foo(arg1, arg2): - """foo now has a persistent cache, trigerring recalculation for values stored more than 3 days.""" + """foo now has a persistent cache, triggering recalculation for values stored more than 3 days.""" return {'arg1': arg1, 'arg2': arg2} @@ -150,7 +150,7 @@ The current defaults can be fetched by calling `get_default_params`. Threads Limit ~~~~~~~~~~~~~ -To limit the number of threads Cachier is allowed to spawn, set the ``CACHIER_MAX_WORKERS`` with the desired number. The defeault is 8, so to enable Cachier to spawn even more threads, you'll have to set a higher limit explicitly. +To limit the number of threads Cachier is allowed to spawn, set the ``CACHIER_MAX_WORKERS`` with the desired number. The default is 8, so to enable Cachier to spawn even more threads, you'll have to set a higher limit explicitly. Global Enable/Disable @@ -406,7 +406,7 @@ Running MongoDB tests against a live MongoDB instance **Note to developers:** By default, all MongoDB tests are run against a mocked MongoDB instance, provided by the ``pymongo_inmemory`` package. To run them against a live MongoDB instance, the ``CACHIER_TEST_VS_LIVE_MONGO`` environment variable is set to ``True`` in the ``test`` environment of this repository (and additional environment variables are populated with the appropriate credentials), used by the GitHub Action running tests on every commit and pull request. -Contributers are not expected to run these tests against a live MongoDB instance when developing, as credentials for the testing instance used will NOT be shared, but rather use the testing against the in-memory MongoDB instance as a good proxy. +Contributors are not expected to run these tests against a live MongoDB instance when developing, as credentials for the testing instance used will NOT be shared, but rather use the testing against the in-memory MongoDB instance as a good proxy. **HOWEVER, the tests run against a live MongoDB instance when you submit a PR are the determining tests for deciding whether your code functions correctly against MongoDB.** diff --git a/cachier/_version.py b/cachier/_version.py index 3660bfda..03acd86d 100644 --- a/cachier/_version.py +++ b/cachier/_version.py @@ -241,7 +241,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command): # TAG-NUM-gHEX mo = re.search(r'^(.+)-(\d+)-g([0-9a-f]+)$', git_describe) if not mo: - # unparseable. Maybe git-describe is misbehaving? + # unparsable. Maybe git-describe is misbehaving? pieces["error"] = ("unable to parse git-describe output: '%s'" % describe_out) return pieces diff --git a/cachier/base_core.py b/cachier/base_core.py index 84f35785..50707397 100644 --- a/cachier/base_core.py +++ b/cachier/base_core.py @@ -23,7 +23,7 @@ def __init__(self, hash_func, default_params): def set_func(self, func): """Sets the function this core will use. This has to be set before any - method is called. Also determine if the funtion is an object method.""" + method is called. Also determine if the function is an object method.""" func_params = list(inspect.signature(func).parameters) self.func_is_method = func_params and func_params[0] == 'self' self.func = func @@ -48,7 +48,7 @@ def precache_value(self, args, kwds, value_to_cache): return value_to_cache def check_calc_timeout(self, time_spent): - """Raise an exception if a recalulation is needed.""" + """Raise an exception if a recalculation is needed.""" if self.wait_for_calc_timeout is not None: calc_timeout = self.wait_for_calc_timeout else: diff --git a/cachier/pickle_core.py b/cachier/pickle_core.py index 5791272f..c76ffe77 100644 --- a/cachier/pickle_core.py +++ b/cachier/pickle_core.py @@ -15,7 +15,7 @@ from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler -# Altenative: https://github.com/WoLpH/portalocker +# Alternative: https://github.com/WoLpH/portalocker from .base_core import _BaseCore @@ -58,11 +58,11 @@ def _check_calculation(self): # print(entry) try: if not entry['being_calculated']: - # print('stoping observer!') + # print('stopping observer!') self.value = entry['value'] self.observer.stop() # else: - # print('NOT stoping observer... :(') + # print('NOT stopping observer... :(') except TypeError: self.value = None self.observer.stop() diff --git a/tests/test_pickle_core.py b/tests/test_pickle_core.py index c3ce0473..199c31a3 100644 --- a/tests/test_pickle_core.py +++ b/tests/test_pickle_core.py @@ -379,7 +379,7 @@ def _helper_bad_cache_file(sleeptime, separate_files): return True -# we want this to succeed at leat once +# we want this to succeed at least once @pytest.mark.pickle @pytest.mark.xfail @pytest.mark.parametrize('separate_files', [True, False])