From 461a79e1e8989e2984c868caad290d6e8dd6585a Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Mon, 25 Nov 2019 06:48:36 +0545 Subject: [PATCH] Fix typos --- dvc/cli.py | 2 +- dvc/command/version.py | 2 +- dvc/daemon.py | 2 +- dvc/logger.py | 4 ++-- dvc/path_info.py | 2 +- dvc/remote/local.py | 2 +- dvc/repo/brancher.py | 2 +- dvc/repo/diff.py | 2 +- dvc/repo/reproduce.py | 2 +- dvc/scm/base.py | 2 +- dvc/state.py | 2 +- dvc/utils/stage.py | 2 +- scripts/build_posix.sh | 2 +- scripts/ci/install.sh | 2 +- scripts/completion/dvc.zsh | 2 +- scripts/innosetup/modpath.iss | 2 +- setup.py | 2 +- tests/func/test_add.py | 2 +- tests/func/test_import.py | 2 +- tests/func/test_install.py | 2 +- tests/func/test_repro.py | 2 +- tests/func/test_system.py | 2 +- tests/unit/output/test_local.py | 2 +- 23 files changed, 24 insertions(+), 24 deletions(-) diff --git a/dvc/cli.py b/dvc/cli.py index 782723e070..ba4c929c30 100644 --- a/dvc/cli.py +++ b/dvc/cli.py @@ -105,7 +105,7 @@ def get_parent_parser(): """Create instances of a parser containing common arguments shared among all the commands. - When overwritting `-q` or `-v`, you need to instantiate a new object + When overwriting `-q` or `-v`, you need to instantiate a new object in order to prevent some weird behavior. """ parent_parser = argparse.ArgumentParser(add_help=False) diff --git a/dvc/command/version.py b/dvc/command/version.py index e8e687d2db..91fa69fbdf 100644 --- a/dvc/command/version.py +++ b/dvc/command/version.py @@ -93,7 +93,7 @@ def get_fs_type(path): for parent in itertools.chain([path], path.parents): if parent in partition: return partition[parent] - return ("unkown", "none") + return ("unknown", "none") @staticmethod def get_linktype_support_info(repo): diff --git a/dvc/daemon.py b/dvc/daemon.py index ebef6f2e5a..9b36e7f6e6 100644 --- a/dvc/daemon.py +++ b/dvc/daemon.py @@ -39,7 +39,7 @@ def _spawn_windows(cmd, env): def _spawn_posix(cmd, env): # NOTE: using os._exit instead of sys.exit, because dvc built - # with PyInstaller has trouble with SystemExit exeption and throws + # with PyInstaller has trouble with SystemExit exception and throws # errors such as "[26338] Failed to execute script __main__" try: pid = os.fork() diff --git a/dvc/logger.py b/dvc/logger.py index f6104777bb..cbb059ae95 100644 --- a/dvc/logger.py +++ b/dvc/logger.py @@ -49,7 +49,7 @@ class ColorFormatter(logging.Formatter): __ https://pypi.python.org/pypi/colorama For records containing `exc_info`, it will use a custom `_walk_exc` to - retrieve the whole tracebak. + retrieve the whole traceback. """ color_code = { @@ -154,7 +154,7 @@ def handleError(self, record): raise LoggingException(record) def emit(self, record): - """Write to Tqdm's stream so as to not break progressbars""" + """Write to Tqdm's stream so as to not break progress-bars""" try: msg = self.format(record) Tqdm.write( diff --git a/dvc/path_info.py b/dvc/path_info.py index 15b3fe25fa..8602417789 100644 --- a/dvc/path_info.py +++ b/dvc/path_info.py @@ -43,7 +43,7 @@ def from_posix(cls, s): def as_posix(self): f = self._flavour # Unlike original implementation [1] that uses `str()` we actually need - # to use `fspath`, because we've overriden `__str__` method to return + # to use `fspath`, because we've overridden `__str__` method to return # relative paths, which will break original `as_posix`. # # [1] https://github.com/python/cpython/blob/v3.7.0/Lib/pathlib.py#L692 diff --git a/dvc/remote/local.py b/dvc/remote/local.py index 0293080a82..da922904cc 100644 --- a/dvc/remote/local.py +++ b/dvc/remote/local.py @@ -183,7 +183,7 @@ def hardlink(self, from_info, to_info): # will get something like: `too many links error` # # This is because all those empty files will have the same checksum - # (i.e. 68b329da9893e34099c7d8ad5cb9c940), therfore, they will be + # (i.e. 68b329da9893e34099c7d8ad5cb9c940), therefore, they will be # linked to the same file in the cache. # # From https://en.wikipedia.org/wiki/Hard_link diff --git a/dvc/repo/brancher.py b/dvc/repo/brancher.py index 9b01c91d60..acca98c2c2 100644 --- a/dvc/repo/brancher.py +++ b/dvc/repo/brancher.py @@ -23,7 +23,7 @@ def brancher( # noqa: E302 str: the display name for the currently selected tree, it could be: - a git revision identifier - empty string it there is no branches to iterate over - - "Working Tree" if there are uncommited changes in the SCM repo + - "Working Tree" if there are uncommitted changes in the SCM repo """ if not any([branches, all_branches, tags, all_tags, all_commits]): yield "" diff --git a/dvc/repo/diff.py b/dvc/repo/diff.py index 8d42983a38..6b681bedca 100644 --- a/dvc/repo/diff.py +++ b/dvc/repo/diff.py @@ -220,7 +220,7 @@ def _diff_royal(self, target, diff_dct): @locked def diff(self, a_ref, target=None, b_ref=None): - """Gerenates diff message string output + """Generates diff message string output Args: target(str) - file/directory to check diff of diff --git a/dvc/repo/reproduce.py b/dvc/repo/reproduce.py index 2eecd3d3a5..67bd781806 100644 --- a/dvc/repo/reproduce.py +++ b/dvc/repo/reproduce.py @@ -137,7 +137,7 @@ def _reproduce_stages( The derived evaluation of D would be: [A, B, C, D] - In case that `downstream` option is specifed, the desired effect + In case that `downstream` option is specified, the desired effect is to derive the evaluation starting from the given stage up to the ancestors. However, the `networkx.ancestors` returns a set, without any guarantee of any order, so we are going to reverse the graph and diff --git a/dvc/scm/base.py b/dvc/scm/base.py index 4815e4abc8..499c703790 100644 --- a/dvc/scm/base.py +++ b/dvc/scm/base.py @@ -104,7 +104,7 @@ def is_tracked(self, path): # pylint: disable=no-self-use, unused-argument return False def is_dirty(self): - """Return whether the SCM contains uncommited changes.""" + """Return whether the SCM contains uncommitted changes.""" return False def active_branch(self): # pylint: disable=no-self-use diff --git a/dvc/state.py b/dvc/state.py index 6ef52a114a..136f99a44f 100644 --- a/dvc/state.py +++ b/dvc/state.py @@ -361,7 +361,7 @@ def get_state_record_for_inode(self, inode): self._execute(cmd, (self._to_sqlite(inode),)) results = self._fetchall() if results: - # uniquness constrain on inode + # uniqueness constrain on inode assert len(results) == 1 return results[0] return None diff --git a/dvc/utils/stage.py b/dvc/utils/stage.py index c3a4b0e66e..0758c8b461 100644 --- a/dvc/utils/stage.py +++ b/dvc/utils/stage.py @@ -26,7 +26,7 @@ def parse_stage(text, path): def parse_stage_for_update(text, path): """Parses text into Python structure. - Unlike `parse_stage()` this returns ordereddicts, values have special + Unlike `parse_stage()` this returns ordered dicts, values have special attributes to store comments and line breaks. This allows us to preserve all of those upon dump. diff --git a/scripts/build_posix.sh b/scripts/build_posix.sh index 53e07dacfb..da89bd757f 100755 --- a/scripts/build_posix.sh +++ b/scripts/build_posix.sh @@ -88,7 +88,7 @@ install_dependencies() gem install --no-document fpm - print_info "Uprgading pip..." + print_info "Upgrading pip..." pip install --upgrade pip print_info "Installing requirements..." diff --git a/scripts/ci/install.sh b/scripts/ci/install.sh index d00d43c12b..f3b9647e48 100644 --- a/scripts/ci/install.sh +++ b/scripts/ci/install.sh @@ -6,7 +6,7 @@ set -e scriptdir="$(dirname $0)" # NOTE: it is not uncommon for pip to hang on travis for what seems to be -# networking issues. Thus, let's retry a few times to see if it will eventially +# networking issues. Thus, let's retry a few times to see if it will eventually # work or not. $scriptdir/retry.sh pip install --upgrade pip setuptools wheel $scriptdir/retry.sh pip install .[all,tests] diff --git a/scripts/completion/dvc.zsh b/scripts/completion/dvc.zsh index 8390ff7c4f..ecbea7cef0 100644 --- a/scripts/completion/dvc.zsh +++ b/scripts/completion/dvc.zsh @@ -42,7 +42,7 @@ _dvc_commands() { "unlock:Unlock DVC-file." "unprotect:Unprotect data file/directory." "update:Update data artifacts imported from other DVC repositories." - "version:Show DVC version and system/environment informaion." + "version:Show DVC version and system/environment information." ) _describe 'dvc commands' _commands diff --git a/scripts/innosetup/modpath.iss b/scripts/innosetup/modpath.iss index 176dad5371..2e5f9cabc6 100644 --- a/scripts/innosetup/modpath.iss +++ b/scripts/innosetup/modpath.iss @@ -151,7 +151,7 @@ begin end; end; -// Split a string into an array using passed delimeter +// Split a string into an array using passed delimiter procedure MPExplode(var Dest: TArrayOfString; Text: String; Separator: String); var i: Integer; diff --git a/setup.py b/setup.py index 4363d6b279..ae460aa3c8 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ # by your package during runtime, you need to **pin** the build version. # # This custom class will replace the version.py module with a **static** -# `__version__` that your package can read at runtime, assuring consistancy. +# `__version__` that your package can read at runtime, assuring consistency. # # References: # - https://docs.python.org/3.7/distutils/extending.html diff --git a/tests/func/test_add.py b/tests/func/test_add.py index 2906403ac2..6d51f233ca 100644 --- a/tests/func/test_add.py +++ b/tests/func/test_add.py @@ -59,7 +59,7 @@ def test_unicode(self): self.assertTrue(os.path.isfile(stage.path)) -class TestAddUnupportedFile(TestDvc): +class TestAddUnSupportedFile(TestDvc): def test(self): with self.assertRaises(DvcException): self.dvc.add("unsupported://unsupported") diff --git a/tests/func/test_import.py b/tests/func/test_import.py index 067d5be8eb..ee6c57d1fd 100644 --- a/tests/func/test_import.py +++ b/tests/func/test_import.py @@ -148,7 +148,7 @@ def test_pull_non_workspace(git, dvc_repo, erepo): dvc_repo.scm.commit("imported branch") dvc_repo.scm.tag("ref-to-branch") - # Ovewrite via import + # Overwrite via import dvc_repo.imp(erepo.root_dir, src, dst, rev="master") os.remove(stage.outs[0].cache_path) diff --git a/tests/func/test_install.py b/tests/func/test_install.py index 1a13dc591c..0b10b3ee6b 100644 --- a/tests/func/test_install.py +++ b/tests/func/test_install.py @@ -48,7 +48,7 @@ def test_should_post_checkout_hook_checkout(self, repo_dir, git, dvc_repo): dvc_repo.scm.commit("add") os.unlink(repo_dir.FOO) - dvc_repo.scm.checkout("new_branc", create_new=True) + dvc_repo.scm.checkout("new_branch", create_new=True) assert os.path.isfile(repo_dir.FOO) diff --git a/tests/func/test_repro.py b/tests/func/test_repro.py index 68883dd4fe..ae0727c144 100644 --- a/tests/func/test_repro.py +++ b/tests/func/test_repro.py @@ -537,7 +537,7 @@ def test(self): file1 = "file1" file1_stage = file1 + ".dvc" # NOTE: purposefully not specifying dependencies - # to create a callbacs stage. + # to create a callback stage. stage = self.dvc.run( fname=file1_stage, outs=[file1], diff --git a/tests/func/test_system.py b/tests/func/test_system.py index e71247549c..12c42b6d1f 100644 --- a/tests/func/test_system.py +++ b/tests/func/test_system.py @@ -7,7 +7,7 @@ @pytest.mark.skipif(os.name != "nt", reason="Windows specific") def test_getdirinfo(tmp_path): - # simulate someone holding an exclussive access + # simulate someone holding an exclusive access locked = str(tmp_path / "locked") fd = os.open(locked, os.O_WRONLY | os.O_CREAT | os.O_EXCL) try: diff --git a/tests/unit/output/test_local.py b/tests/unit/output/test_local.py index 82d671cf73..1e64d32ac5 100644 --- a/tests/unit/output/test_local.py +++ b/tests/unit/output/test_local.py @@ -67,7 +67,7 @@ def test_return_0_on_no_cache(self): "get_dir_cache", return_value=[{"md5": "asdf"}, {"md5": "qwe"}], ) - def test_return_mutiple_for_dir(self, mock_get_dir_cache): + def test_return_multiple_for_dir(self, mock_get_dir_cache): o = self._get_output() self.assertEqual(2, o.get_files_number())