From e997896e2ea136d19fc62e3c24f2c2eb15a22213 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 12 Mar 2023 14:35:33 -0400 Subject: [PATCH 1/4] Add github action to codespell main on push and PRs --- .github/workflows/codespell.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..243ba8c --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,19 @@ +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Codespell + uses: codespell-project/actions-codespell@v1 From b8bda5e1a38060c2976e472b9a19705dce4ab11b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sun, 12 Mar 2023 14:35:33 -0400 Subject: [PATCH 2/4] Add rudimentary .codespellrc --- .codespellrc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..bb1b587 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = .git,*.pdf,*.svg,versioneer.py +# ignore-words-list = From 226598aad6999746e06de2402d6ec10fef5d57a2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 29 Sep 2023 13:47:30 -0400 Subject: [PATCH 3/4] [DATALAD RUNCMD] run codespell throughout but ignore fail === Do not change lines below === { "chain": [], "cmd": "codespell -w || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- CHANGELOG.md | 2 +- _datalad_buildsupport/formatters.py | 2 +- datalad_dataverse/_version.py | 2 +- datalad_dataverse/add_sibling_dataverse.py | 4 ++-- datalad_dataverse/baseremote.py | 6 +++--- datalad_dataverse/dataset.py | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07529e2..e552200 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## 🐛 Bug Fixes -- Wrong argument specification broke the commmand line interface of +- Wrong argument specification broke the command line interface of `add-sibling-dataverse`. Fixes https://github.com/datalad/datalad-dataverse/issues/289 via https://github.com/datalad/datalad-dataverse/pull/290 (by diff --git a/_datalad_buildsupport/formatters.py b/_datalad_buildsupport/formatters.py index 5ac01de..a88a99b 100644 --- a/_datalad_buildsupport/formatters.py +++ b/_datalad_buildsupport/formatters.py @@ -75,7 +75,7 @@ def _mk_title(self, prog): def _mk_name(self, prog, desc): """ - this method is in consitent with others ... it relies on + this method is in consistent with others ... it relies on distribution """ desc = desc.splitlines()[0] if desc else 'it is in the name' diff --git a/datalad_dataverse/_version.py b/datalad_dataverse/_version.py index a49cf4a..9e7c0ea 100644 --- a/datalad_dataverse/_version.py +++ b/datalad_dataverse/_version.py @@ -268,7 +268,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/datalad_dataverse/add_sibling_dataverse.py b/datalad_dataverse/add_sibling_dataverse.py index b505907..d7b30fa 100644 --- a/datalad_dataverse/add_sibling_dataverse.py +++ b/datalad_dataverse/add_sibling_dataverse.py @@ -333,7 +333,7 @@ def _add_git_sibling( name: str credential_name: str originally given credential reference - needed to decide whether or not - to incude in datalad-annex URL + to include in datalad-annex URL export: bool existing: {skip, error, reconfigure} known: bool @@ -404,7 +404,7 @@ def _add_storage_sibling( (Presently unused) known: bool Flag whether the sibling is a known remote (no implied - necessary existance of content on the remote). + necessary existence of content on the remote). """ if known and existing == 'skip': yield _get_skip_sibling_result(name, ds, 'storage') diff --git a/datalad_dataverse/baseremote.py b/datalad_dataverse/baseremote.py index 2d0c012..76d8fae 100644 --- a/datalad_dataverse/baseremote.py +++ b/datalad_dataverse/baseremote.py @@ -61,7 +61,7 @@ class DataverseRemote(SpecialRemote): special remote records the IDs of annex keys and tries to rely on them if possible. - Dataverse imposes strict nameing limitations for directories and files. + Dataverse imposes strict naming limitations for directories and files. See https://github.com/IQSS/dataverse/issues/8807#issuecomment-1164434278 Therefore, remote paths are mangles to match these limitations. """ @@ -257,7 +257,7 @@ def _remove_annex_fileid_record(self, key: str, fileid: int) -> None: self._set_annex_fileid_record(key, r) def _get_remotepath_for_key(self, key: str) -> PurePosixPath: - """Return the cannonical remote path for a given key + """Return the canonical remote path for a given key Parameters ---------- @@ -399,7 +399,7 @@ def _remove_file(self, key: str, rm_id: int | None): # file, if it has a persistent URL (should be findable in # self.old_dataset_versions) or even via api/access/datafile/811. # However, that depends on permissions, etc., so not clear it's - # useful or desireable to always do that. + # useful or desirable to always do that. # Otherwise not seeing a solution ATM. See https://github.com/datalad/datalad-dataverse/issues/146#issuecomment-1214409351 pass diff --git a/datalad_dataverse/dataset.py b/datalad_dataverse/dataset.py index 15f60a0..7fb8f52 100644 --- a/datalad_dataverse/dataset.py +++ b/datalad_dataverse/dataset.py @@ -58,7 +58,7 @@ class OnlineDataverseDataset: scopes. On initialization only a record of what is in the latest version (draft or - not) of the dataverse dataset is retrived, including an annotation of + not) of the dataverse dataset is retrieved, including an annotation of content on whether it is released. This annotation is crucial, since it has implications on what to record should changes be uploaded. For example: It is not possible to actually remove content from a released @@ -442,7 +442,7 @@ def _file_records_by_fileid(self): retrieval of keys that are not present in the latest version anymore. Note, that whie initially we may not be in a draft, we are as soon as we - change things (upload/repace/remove/rename). We keep track of those + change things (upload/replace/remove/rename). We keep track of those changes herein w/o rerequesting the new state. """ From 9a7395d79b737478f5ee8ea5da712ff514c69285 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 29 Sep 2023 13:48:13 -0400 Subject: [PATCH 4/4] [DATALAD RUNCMD] Do interactive fixing of some ambigous typos === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- datalad_dataverse/baseremote.py | 2 +- datalad_dataverse/tests/test_dataset.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/datalad_dataverse/baseremote.py b/datalad_dataverse/baseremote.py index 76d8fae..8a02870 100644 --- a/datalad_dataverse/baseremote.py +++ b/datalad_dataverse/baseremote.py @@ -332,7 +332,7 @@ def _upload_file(self, remote_path, key, local_file, replace_id): # git-annex-testremote ("store when already present"). # Generally it's kinda fine, but we'd better figure this out more # reliably. Note, that we have to deal with annex keys, which are - # not hash based (for example the special keys fo datalad-annex + # not hash based (for example the special keys of datalad-annex # git-remote-helper). # Hence, having the key on the remote end, doesn't mean it's # identical. So, we can't catch it beforehand this way. diff --git a/datalad_dataverse/tests/test_dataset.py b/datalad_dataverse/tests/test_dataset.py index 110aaea..a7ff1e3 100644 --- a/datalad_dataverse/tests/test_dataset.py +++ b/datalad_dataverse/tests/test_dataset.py @@ -1,6 +1,6 @@ """Tests OnlineDataverseDataset -These tests (should) somewhat close mirror the ones fpr pydataverse. +These tests (should) somewhat close mirror the ones for pydataverse. At least as long as we are using that API layer. """