Skip to content

Commit

Permalink
pre-commit: introduce codespell check
Browse files Browse the repository at this point in the history
* codespell --ignore-words-list="ba,datas,fo"

* up-to-date -> uptodate

* Add pre-commit hook...

* Pre-commit needs quotes?

* Single quotes?

* Arrrgggsss

* Update .pre-commit-config.yaml

Co-authored-by: Saugat Pachhai <[email protected]>

Co-authored-by: Saugat Pachhai <[email protected]>
  • Loading branch information
cclauss and skshetry authored Jul 7, 2021
1 parent 9d9ff10 commit 40f24e5
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 19 deletions.
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ Comparison to related technologies

#. *Data Engineering* tools such as `AirFlow <https://airflow.apache.org/>`_, `Luigi <https://github.com/spotify/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 <https://github.com/covid-genomics/airflow-dvc>`_ is an example
of such integration.

Expand Down
20 changes: 10 additions & 10 deletions dvc/dagascii.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dvc/fs/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dvc/fs/fsspec_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion dvc/repo/experiments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
2 changes: 1 addition & 1 deletion dvc/scm/git/backend/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion scripts/innosetup/setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions tests/func/plots/test_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion tests/func/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 40f24e5

Please sign in to comment.