diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9257062967..b567ef2cff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,6 +7,13 @@ repos: language_version: python3 repo: https://github.com/ambv/black rev: 21.6b0 + - hooks: + - id: codespell + args: + - --ignore-words-list + - ba,datas,fo,uptodate + repo: https://github.com/codespell-project/codespell + rev: v2.1.0 - hooks: - id: isort language_version: python3 diff --git a/README.rst b/README.rst index e216309d18..566e62bf51 100644 --- a/README.rst +++ b/README.rst @@ -184,7 +184,7 @@ Comparison to related technologies #. *Data Engineering* tools such as `AirFlow `_, `Luigi `_ and others - in DVC data, model and ML pipelines represent a single ML project and focuses on data scientist' experience while - data engineering pipeline orchestrates multiple data projects and focuses on efficent execution. DVC project can be used + data engineering pipeline orchestrates multiple data projects and focuses on efficient execution. DVC project can be used from data pipeline as a single execution step. `AirFlow DVC `_ is an example of such integration. diff --git a/dvc/dagascii.py b/dvc/dagascii.py index 5e6a48d160..af99f23ad4 100644 --- a/dvc/dagascii.py +++ b/dvc/dagascii.py @@ -163,7 +163,7 @@ def box(self, x0, y0, width, height): self.point(x0 + width, y0 + height, "+") -def _build_sugiyama_layout(vertexes, edges): +def _build_sugiyama_layout(vertices, edges): # # Just a reminder about naming conventions: # +------------X @@ -174,17 +174,17 @@ def _build_sugiyama_layout(vertexes, edges): # Y # - vertexes = {v: Vertex(f" {v} ") for v in vertexes} + vertices = {v: Vertex(f" {v} ") for v in vertices} # NOTE: reverting edges to correctly orientate the graph - edges = [Edge(vertexes[e], vertexes[s]) for s, e in edges] - vertexes = vertexes.values() - graph = Graph(vertexes, edges) + edges = [Edge(vertices[e], vertices[s]) for s, e in edges] + vertices = vertices.values() + graph = Graph(vertices, edges) - for vertex in vertexes: + for vertex in vertices: vertex.view = VertexViewer(vertex.data) # NOTE: determine min box length to create the best layout - minw = min(v.view.w for v in vertexes) + minw = min(v.view.w for v in vertices) for edge in edges: edge.view = EdgeViewer() @@ -204,11 +204,11 @@ def _build_sugiyama_layout(vertexes, edges): return sug -def draw(vertexes, edges): +def draw(vertices, edges): """Build a DAG and draw it in ASCII. Args: - vertexes (list): list of graph vertexes. + vertices (list): list of graph vertices. edges (list): list of graph edges. """ # pylint: disable=too-many-locals @@ -217,7 +217,7 @@ def draw(vertexes, edges): Xs = [] # pylint: disable=invalid-name Ys = [] # pylint: disable=invalid-name - sug = _build_sugiyama_layout(vertexes, edges) + sug = _build_sugiyama_layout(vertices, edges) for vertex in sug.g.sV: # NOTE: moving boxes w/2 to the left diff --git a/dvc/fs/azure.py b/dvc/fs/azure.py index 4004e258b2..8b252d9505 100644 --- a/dvc/fs/azure.py +++ b/dvc/fs/azure.py @@ -25,7 +25,7 @@ @contextmanager def _temp_event_loop(): - """When trying to initalize azure filesystem instances + """When trying to initialize azure filesystem instances with DefaultCredentials, the authentication process requires to have an access to a separate event loop. The normal calls are run in a separate loop managed by the fsspec, but the diff --git a/dvc/fs/fsspec_wrapper.py b/dvc/fs/fsspec_wrapper.py index ec92c4f922..53d52889ae 100644 --- a/dvc/fs/fsspec_wrapper.py +++ b/dvc/fs/fsspec_wrapper.py @@ -48,7 +48,7 @@ def _strip_buckets(self, entries, detail=False): yield entry def _entry_hook(self, entry): - """Simple hook method to be overriden when wanted to process + """Simple hook method to be overridden when wanted to process entries within info() and ls(detail=True) calls""" return entry diff --git a/dvc/repo/experiments/__init__.py b/dvc/repo/experiments/__init__.py index a2c4e04e16..64b41623df 100644 --- a/dvc/repo/experiments/__init__.py +++ b/dvc/repo/experiments/__init__.py @@ -753,7 +753,7 @@ def _workspace_repro(self) -> Mapping[str, str]: assert entry.index == 0 # NOTE: the stash commit to be popped already contains all the current - # workspace changes plus CLI modifed --params changes. + # workspace changes plus CLI modified --params changes. # `checkout --force` here will not lose any data (popping stash commit # will result in conflict between workspace params and stashed CLI # params, but we always want the stashed version). diff --git a/dvc/scm/git/backend/base.py b/dvc/scm/git/backend/base.py index 02808c59ee..3196f35907 100644 --- a/dvc/scm/git/backend/base.py +++ b/dvc/scm/git/backend/base.py @@ -187,7 +187,7 @@ def iter_remote_refs(self, url: str, base: Optional[str] = None): @abstractmethod def get_refs_containing(self, rev: str, pattern: Optional[str] = None): - """Iterate over all git refs containing the specfied revision.""" + """Iterate over all git refs containing the specified revision.""" @abstractmethod def push_refspec( diff --git a/scripts/innosetup/setup.iss b/scripts/innosetup/setup.iss index a892060639..3ee23b31bb 100644 --- a/scripts/innosetup/setup.iss +++ b/scripts/innosetup/setup.iss @@ -34,7 +34,7 @@ Source: "{#MyAppDir}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs c [Tasks] Name: modifypath; Description: Adds dvc's application directory to environmental path; Flags: checkablealone; -Name: modifypath\system; Description: Adds dvc's application directory to enviromental path for all users; +Name: modifypath\system; Description: Adds dvc's application directory to environmental path for all users; Name: addsymlinkpermissions; Description: Add permission for creating symbolic links; Flags: checkablealone; Name: addsymlinkpermissions\system; Description: Add permissions for creating symbolic links for all users; diff --git a/tests/func/plots/test_show.py b/tests/func/plots/test_show.py index 221e3fecf0..327389d0e6 100644 --- a/tests/func/plots/test_show.py +++ b/tests/func/plots/test_show.py @@ -571,7 +571,7 @@ def test_raise_on_wrong_field(tmp_dir, scm, dvc, run_copy_metrics): def test_load_metric_from_dict_json(tmp_dir): - metric = [{"acccuracy": 1, "loss": 2}, {"accuracy": 3, "loss": 4}] + metric = [{"accuracy": 1, "loss": 2}, {"accuracy": 3, "loss": 4}] dmetric = {"train": metric} plot_data = JSONPlotData("-", "revision", json.dumps(dmetric)) @@ -584,7 +584,7 @@ def test_load_metric_from_dict_json(tmp_dir): def test_load_metric_from_dict_yaml(tmp_dir): - metric = [{"acccuracy": 1, "loss": 2}, {"accuracy": 3, "loss": 4}] + metric = [{"accuracy": 1, "loss": 2}, {"accuracy": 3, "loss": 4}] dmetric = {"train": metric} plot_data = YAMLPlotData("-", "revision", dumps_yaml(dmetric)) diff --git a/tests/func/test_status.py b/tests/func/test_status.py index c0c1024a95..655c179c6a 100644 --- a/tests/func/test_status.py +++ b/tests/func/test_status.py @@ -49,7 +49,7 @@ def test_status_non_dvc_repo_import(tmp_dir, dvc, git_dir): def test_status_before_and_after_dvc_init(tmp_dir, dvc, git_dir): - git_dir.scm_gen("file", "first version", commit="first verison") + git_dir.scm_gen("file", "first version", commit="first version") old_rev = git_dir.scm.get_rev() dvc.imp(os.fspath(git_dir), "file", "file")