From dde3a8bd9229ff25ec8bc03c35d937f43233f48e Mon Sep 17 00:00:00 2001 From: luz paz Date: Sat, 7 May 2022 15:59:10 -0400 Subject: [PATCH] Fix various typos Found via `codespell -q 3 -S ./git/ext/gitdb,./test/fixtures/reflog_master,./test/fixtures/diff_mode_only,./test/fixtures/reflog_HEAD` --- doc/source/changes.rst | 6 +++--- git/config.py | 2 +- git/index/base.py | 8 ++++---- git/index/fun.py | 2 +- git/objects/base.py | 2 +- git/objects/commit.py | 4 ++-- git/objects/submodule/root.py | 2 +- git/objects/util.py | 4 ++-- git/refs/symbolic.py | 2 +- git/refs/tag.py | 4 ++-- git/repo/base.py | 4 ++-- git/repo/fun.py | 2 +- git/types.py | 2 +- pyproject.toml | 2 +- test/fixtures/diff_p | 2 +- test/fixtures/git_config | 2 +- test/fixtures/rev_list_bisect_all | 2 +- test/test_config.py | 2 +- test/test_diff.py | 2 +- test/test_docs.py | 2 +- test/test_git.py | 2 +- test/test_index.py | 2 +- test/test_submodule.py | 4 ++-- 23 files changed, 33 insertions(+), 33 deletions(-) diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 3f22a4866..f37c81677 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -69,7 +69,7 @@ https://github.com/gitpython-developers/gitpython/milestone/53?closed=1 - Make Protocol classes ABCs at runtime due to new behaviour/bug in 3.9.7 & 3.10.0-rc1 - - Remove use of typing.TypeGuard until later release, to allow dependant libs time to update. + - Remove use of typing.TypeGuard until later release, to allow dependent libs time to update. - Tracking issue: https://github.com/gitpython-developers/GitPython/issues/1095 @@ -134,7 +134,7 @@ https://github.com/gitpython-developers/gitpython/milestone/48?closed=1 3.1.15 (YANKED) =============== -* add deprectation warning for python 3.5 +* add deprecation warning for python 3.5 See the following for details: https://github.com/gitpython-developers/gitpython/milestone/47?closed=1 @@ -595,7 +595,7 @@ It follows the `semantic version scheme `_, and thus will not - Renamed `ignore_tree_extension_data` keyword argument in `IndexFile.write(...)` to `ignore_extension_data` * If the git command executed during `Remote.push(...)|fetch(...)` returns with an non-zero exit code and GitPython didn't obtain any head-information, the corresponding `GitCommandError` will be raised. This may break previous code which expected - these operations to never raise. However, that behavious is undesirable as it would effectively hide the fact that there + these operations to never raise. However, that behaviour is undesirable as it would effectively hide the fact that there was an error. See `this issue `__ for more information. * If the git executable can't be found in the PATH or at the path provided by `GIT_PYTHON_GIT_EXECUTABLE`, this is made diff --git a/git/config.py b/git/config.py index cbd66022d..1ac3c9cec 100644 --- a/git/config.py +++ b/git/config.py @@ -71,7 +71,7 @@ class MetaParserBuilder(abc.ABCMeta): - """Utlity class wrapping base-class methods into decorators that assure read-only properties""" + """Utility class wrapping base-class methods into decorators that assure read-only properties""" def __new__(cls, name: str, bases: Tuple, clsdict: Dict[str, Any]) -> 'MetaParserBuilder': """ Equip all base-class methods with a needs_values decorator, and all non-const methods diff --git a/git/index/base.py b/git/index/base.py index 209bfa8de..00e51bf5e 100644 --- a/git/index/base.py +++ b/git/index/base.py @@ -579,7 +579,7 @@ def _process_diff_args(self, # type: ignore[override] def _to_relative_path(self, path: PathLike) -> PathLike: """ :return: Version of path relative to our git directory or raise ValueError - if it is not within our git direcotory""" + if it is not within our git directory""" if not osp.isabs(path): return path if self.repo.bare: @@ -682,7 +682,7 @@ def add(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, 'Submodule'] into the object database. PathStrings may contain globs, such as 'lib/__init__*' or can be directories - like 'lib', the latter ones will add all the files within the dirctory and + like 'lib', the latter ones will add all the files within the directory and subdirectories. This equals a straight git-add. @@ -779,7 +779,7 @@ def add(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, 'Submodule'] "At least one Entry has a null-mode - please use index.remove to remove files for clarity") # END null mode should be remove - # HANLDE ENTRY OBJECT CREATION + # HANDLE ENTRY OBJECT CREATION # create objects if required, otherwise go with the existing shas null_entries_indices = [i for i, e in enumerate(entries) if e.binsha == Object.NULL_BIN_SHA] if null_entries_indices: @@ -813,7 +813,7 @@ def handle_null_entries(self: 'IndexFile') -> None: fprogress(entry.path, False, entry) fprogress(entry.path, True, entry) # END handle progress - # END for each enty + # END for each entry entries_added.extend(entries) # END if there are base entries diff --git a/git/index/fun.py b/git/index/fun.py index 59fa1be19..acab74239 100644 --- a/git/index/fun.py +++ b/git/index/fun.py @@ -314,7 +314,7 @@ def write_tree_from_cache(entries: List[IndexEntry], odb: 'GitCmdObjectDB', sl: # finally create the tree sio = BytesIO() - tree_to_stream(tree_items, sio.write) # writes to stream as bytes, but doesnt change tree_items + tree_to_stream(tree_items, sio.write) # writes to stream as bytes, but doesn't change tree_items sio.seek(0) istream = odb.store(IStream(str_tree_type, len(sio.getvalue()), sio)) diff --git a/git/objects/base.py b/git/objects/base.py index a3b0f230a..66e15a8f5 100644 --- a/git/objects/base.py +++ b/git/objects/base.py @@ -32,7 +32,7 @@ # -------------------------------------------------------------------------- -_assertion_msg_format = "Created object %r whose python type %r disagrees with the acutual git object type %r" +_assertion_msg_format = "Created object %r whose python type %r disagrees with the actual git object type %r" __all__ = ("Object", "IndexObject") diff --git a/git/objects/commit.py b/git/objects/commit.py index 07355e7e6..96a2a8e59 100644 --- a/git/objects/commit.py +++ b/git/objects/commit.py @@ -322,7 +322,7 @@ def trailers(self) -> Dict: Git messages can contain trailer information that are similar to RFC 822 e-mail headers (see: https://git-scm.com/docs/git-interpret-trailers). - This funcions calls ``git interpret-trailers --parse`` onto the message + This functions calls ``git interpret-trailers --parse`` onto the message to extract the trailer information. The key value pairs are stripped of leading and trailing whitespaces before they get saved into a dictionary. @@ -461,7 +461,7 @@ def create_from_tree(cls, repo: 'Repo', tree: Union[Tree, str], message: str, # * Environment variables override configuration values # * Sensible defaults are set according to the git documentation - # COMMITER AND AUTHOR INFO + # COMMITTER AND AUTHOR INFO cr = repo.config_reader() env = os.environ diff --git a/git/objects/submodule/root.py b/git/objects/submodule/root.py index 5e84d1616..08e1f9543 100644 --- a/git/objects/submodule/root.py +++ b/git/objects/submodule/root.py @@ -338,7 +338,7 @@ def update(self, previous_commit: Union[Commit_ish, None] = None, sm.update(recursive=False, init=init, to_latest_revision=to_latest_revision, progress=progress, dry_run=dry_run, force=force_reset, keep_going=keep_going) - # update recursively depth first - question is which inconsitent + # update recursively depth first - question is which inconsistent # state will be better in case it fails somewhere. Defective branch # or defective depth. The RootSubmodule type will never process itself, # which was done in the previous expression diff --git a/git/objects/util.py b/git/objects/util.py index 187318fe6..800eccdf4 100644 --- a/git/objects/util.py +++ b/git/objects/util.py @@ -37,7 +37,7 @@ from .submodule.base import Submodule from git.types import Protocol, runtime_checkable else: - # Protocol = Generic[_T] # NNeeded for typing bug #572? + # Protocol = Generic[_T] # Needed for typing bug #572? Protocol = ABC def runtime_checkable(f): @@ -359,7 +359,7 @@ def _list_traverse(self, as_edge: bool = False, *args: Any, **kwargs: Any out: IterableList[Union['Commit', 'Submodule', 'Tree', 'Blob']] = IterableList(id) out.extend(self.traverse(as_edge=as_edge, *args, **kwargs)) return out - # overloads in subclasses (mypy does't allow typing self: subclass) + # overloads in subclasses (mypy doesn't allow typing self: subclass) # Union[IterableList['Commit'], IterableList['Submodule'], IterableList[Union['Submodule', 'Tree', 'Blob']]] else: # Raise deprecationwarning, doesn't make sense to use this diff --git a/git/refs/symbolic.py b/git/refs/symbolic.py index 1c5506737..8d869173e 100644 --- a/git/refs/symbolic.py +++ b/git/refs/symbolic.py @@ -298,7 +298,7 @@ def set_reference(self, ref: Union[Commit_ish, 'SymbolicReference', str], logmsg: Union[str, None] = None) -> 'SymbolicReference': """Set ourselves to the given ref. It will stay a symbol if the ref is a Reference. Otherwise an Object, given as Object instance or refspec, is assumed and if valid, - will be set which effectively detaches the refererence if it was a purely + will be set which effectively detaches the reference if it was a purely symbolic one. :param ref: SymbolicReference instance, Object instance or refspec string diff --git a/git/refs/tag.py b/git/refs/tag.py index edfab33d8..8cc79eddd 100644 --- a/git/refs/tag.py +++ b/git/refs/tag.py @@ -36,7 +36,7 @@ class TagReference(Reference): _common_path_default = Reference._common_path_default + "/" + _common_default @property - def commit(self) -> 'Commit': # type: ignore[override] # LazyMixin has unrelated comit method + def commit(self) -> 'Commit': # type: ignore[override] # LazyMixin has unrelated commit method """:return: Commit object the tag ref points to :raise ValueError: if the tag points to a tree or blob""" @@ -91,7 +91,7 @@ def create(cls: Type['TagReference'], repo: 'Repo', path: PathLike, :param message: Synonym for :param logmsg: - Included for backwards compatability. :param logmsg is used in preference if both given. + Included for backwards compatibility. :param logmsg is used in preference if both given. :param force: If True, to force creation of a tag even though that tag already exists. diff --git a/git/repo/base.py b/git/repo/base.py index f8bc8128e..bea0dcb57 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -711,7 +711,7 @@ def is_dirty(self, index: bool = True, working_tree: bool = True, untracked_file index or the working copy have changes.""" if self._bare: # Bare repositories with no associated working directory are - # always consired to be clean. + # always considered to be clean. return False # start from the one which is fastest to evaluate @@ -760,7 +760,7 @@ def _get_untracked_files(self, *args: Any, **kwargs: Any) -> List[str]: untracked_files=True, as_process=True, **kwargs) - # Untracked files preffix in porcelain mode + # Untracked files prefix in porcelain mode prefix = "?? " untracked_files = [] for line in proc.stdout: diff --git a/git/repo/fun.py b/git/repo/fun.py index 1a83dd3dc..74c0657d6 100644 --- a/git/repo/fun.py +++ b/git/repo/fun.py @@ -266,7 +266,7 @@ def rev_parse(repo: 'Repo', rev: str) -> Union['Commit', 'Tag', 'Tree', 'Blob']: # END handle tag elif token == '@': # try single int - assert ref is not None, "Requre Reference to access reflog" + assert ref is not None, "Require Reference to access reflog" revlog_index = None try: # transform reversed index into the format of our revlog diff --git a/git/types.py b/git/types.py index 64bf3d96d..7f44ba242 100644 --- a/git/types.py +++ b/git/types.py @@ -54,7 +54,7 @@ def assert_never(inp: NoReturn, raise_error: bool = True, exc: Union[Exception, None] = None) -> None: """For use in exhaustive checking of literal or Enum in if/else chain. - Should only be reached if all memebers not handled OR attempt to pass non-members through chain. + Should only be reached if all members not handled OR attempt to pass non-members through chain. If all members handled, type is Empty. Otherwise, will cause mypy error. If non-members given, should cause mypy error at variable creation. diff --git a/pyproject.toml b/pyproject.toml index 102b6fdc4..da3e605ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [tool.pytest.ini_options] python_files = 'test_*.py' -testpaths = 'test' # space seperated list of paths from root e.g test tests doc/testing +testpaths = 'test' # space separated list of paths from root e.g test tests doc/testing addopts = '--cov=git --cov-report=term --maxfail=10 --force-sugar --disable-warnings' filterwarnings = 'ignore::DeprecationWarning' # --cov coverage diff --git a/test/fixtures/diff_p b/test/fixtures/diff_p index af4759e50..76242b58c 100644 --- a/test/fixtures/diff_p +++ b/test/fixtures/diff_p @@ -397,7 +397,7 @@ index 1d5251d40fb65ac89184ec662a3e1b04d0c24861..98eeddda5ed2b0e215e21128112393bd self.git_dir = git_dir end -- # Converstion hash from Ruby style options to git command line +- # Conversion hash from Ruby style options to git command line - # style options - TRANSFORM = {:max_count => "--max-count=", - :skip => "--skip=", diff --git a/test/fixtures/git_config b/test/fixtures/git_config index b8c178e3f..a8cad56e8 100644 --- a/test/fixtures/git_config +++ b/test/fixtures/git_config @@ -28,7 +28,7 @@ [branch "mainline_performance"] remote = mainline merge = refs/heads/master -# section with value defined before include to be overriden +# section with value defined before include to be overridden [sec] var0 = value0_main [include] diff --git a/test/fixtures/rev_list_bisect_all b/test/fixtures/rev_list_bisect_all index 810b66093..342ea94ae 100644 --- a/test/fixtures/rev_list_bisect_all +++ b/test/fixtures/rev_list_bisect_all @@ -40,7 +40,7 @@ committer David Aguilar 1220418344 -0700 commit: handle --bisect-all output in Commit.list_from_string Rui Abreu Ferrerira pointed out that "git rev-list --bisect-all" - returns a slightly different format which we can easily accomodate + returns a slightly different format which we can easily accommodate by changing the way we parse rev-list output. http://groups.google.com/group/git-python/browse_thread/thread/aed1d5c4b31d5027 diff --git a/test/test_config.py b/test/test_config.py index 8892b8399..50d9b010d 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -175,7 +175,7 @@ def test_base(self): assert num_sections and num_options assert r_config._is_initialized is True - # get value which doesnt exist, with default + # get value which doesn't exist, with default default = "my default value" assert r_config.get_value("doesnt", "exist", default) == default diff --git a/test/test_diff.py b/test/test_diff.py index 9b20893a4..92e27f5d2 100644 --- a/test/test_diff.py +++ b/test/test_diff.py @@ -273,7 +273,7 @@ def test_diff_unsafe_paths(self): self.assertEqual(res[13].b_path, 'b/"with even more quotes"') def test_diff_patch_format(self): - # test all of the 'old' format diffs for completness - it should at least + # test all of the 'old' format diffs for completeness - it should at least # be able to deal with it fixtures = ("diff_2", "diff_2f", "diff_f", "diff_i", "diff_mode_only", "diff_new_mode", "diff_numstat", "diff_p", "diff_rename", diff --git a/test/test_docs.py b/test/test_docs.py index 8897bbb75..08fc84399 100644 --- a/test/test_docs.py +++ b/test/test_docs.py @@ -135,7 +135,7 @@ def update(self, op_code, cur_count, max_count=None, message=''): for fetch_info in origin.fetch(progress=MyProgressPrinter()): print("Updated %s to %s" % (fetch_info.ref, fetch_info.commit)) # create a local branch at the latest fetched master. We specify the name statically, but you have all - # information to do it programatically as well. + # information to do it programmatically as well. bare_master = bare_repo.create_head('master', origin.refs.master) bare_repo.head.set_reference(bare_master) assert not bare_repo.delete_remote(origin).exists() diff --git a/test/test_git.py b/test/test_git.py index 7f52d650f..10e21487a 100644 --- a/test/test_git.py +++ b/test/test_git.py @@ -159,7 +159,7 @@ def test_cmd_override(self): prev_cmd = self.git.GIT_PYTHON_GIT_EXECUTABLE exc = GitCommandNotFound try: - # set it to something that doens't exist, assure it raises + # set it to something that doesn't exist, assure it raises type(self.git).GIT_PYTHON_GIT_EXECUTABLE = osp.join( "some", "path", "which", "doesn't", "exist", "gitbinary") self.assertRaises(exc, self.git.version) diff --git a/test/test_index.py b/test/test_index.py index 233a4c643..4a20a8f65 100644 --- a/test/test_index.py +++ b/test/test_index.py @@ -936,4 +936,4 @@ def test_commit_msg_hook_fail(self, rw_repo): self.assertEqual(err.stderr, "\n stderr: 'stderr\n'") assert str(err) else: - raise AssertionError("Should have cought a HookExecutionError") + raise AssertionError("Should have caught a HookExecutionError") diff --git a/test/test_submodule.py b/test/test_submodule.py index 3307bc788..a79123dcc 100644 --- a/test/test_submodule.py +++ b/test/test_submodule.py @@ -546,7 +546,7 @@ def test_root_module(self, rwrepo): assert nsm.module().head.commit.hexsha == nsm.hexsha nsm.module().index.add([nsm]) nsm.module().index.commit("added new file") - rm.update(recursive=False, dry_run=True, progress=prog) # would not change head, and thus doens't fail + rm.update(recursive=False, dry_run=True, progress=prog) # would not change head, and thus doesn't fail # Everything we can do from now on will trigger the 'future' check, so no is_dirty() check will even run # This would only run if our local branch is in the past and we have uncommitted changes @@ -730,7 +730,7 @@ def test_git_submodules_and_add_sm_with_new_commit(self, rwdir): assert parent.head.commit.tree[sm.path].binsha == sm.binsha assert sm_too.binsha == sm.binsha, "cached submodule should point to the same commit as updated one" - added_bies = parent.index.add([sm]) # addded base-index-entries + added_bies = parent.index.add([sm]) # added base-index-entries assert len(added_bies) == 1 parent.index.commit("add same submodule entry") commit_sm = parent.head.commit.tree[sm.path] pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy