From d2b22bbbf9758eb16f31bcee2a72f718d0a924a8 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 24 Feb 2023 10:10:36 -0500 Subject: [PATCH 1/9] Add github action to codespell master 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 00000000..5768d7c6 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,19 @@ +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +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 13b81f50759606d6fd22c92ceb127949560e871c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 24 Feb 2023 10:10:36 -0500 Subject: [PATCH 2/9] 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 00000000..bfb5a56d --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = .git,*.pdf,*.svg,venvs +# ignore-words-list = From 103c78f50982b0a339774bdf0133c4cdce88887e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 24 Feb 2023 10:11:05 -0500 Subject: [PATCH 3/9] fixing 1 ambigous typo --- docs/source/user_guide/writing-extractors.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/user_guide/writing-extractors.rst b/docs/source/user_guide/writing-extractors.rst index ac345a0e..da1a26c5 100644 --- a/docs/source/user_guide/writing-extractors.rst +++ b/docs/source/user_guide/writing-extractors.rst @@ -171,7 +171,7 @@ extractor instance:: Please not, if dataset level extraction should be performed and you want to provide extractor -parameter, you have to provide thw ``--force-dataset-level`` parameter to ensure +parameter, you have to provide the ``--force-dataset-level`` parameter to ensure dataset-level extraction. i.e. to prevent ``meta-extract`` from interpreting the key of the first extractor argument as file name for a file-level extraction. From 60071c95dcf3569854e1b7ded954d635a2e89906 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 24 Feb 2023 10:13:34 -0500 Subject: [PATCH 4/9] ignore versionner and one var name --- .codespellrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index bfb5a56d..3694999d 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,3 +1,4 @@ [codespell] -skip = .git,*.pdf,*.svg,venvs -# ignore-words-list = +skip = .git,*.pdf,*.svg,venvs,versioneer.py,_version.py +# mke -- is a variable name which makes sense, let's ignore for now until inline skips are supported +ignore-words-list = mke From 7643776a696e9adda5769b5b0997048dae3ba63f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 28 Feb 2023 10:12:59 -0500 Subject: [PATCH 5/9] [DATALAD RUNCMD] Run codespell throughout fixing some typos === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- Makefile | 2 +- _datalad_buildsupport/formatters.py | 2 +- datalad_metalad/__init__.py | 2 +- datalad_metalad/aggregate.py | 4 ++-- datalad_metalad/extractors/core.py | 2 +- datalad_metalad/extractors/tests/test_base.py | 2 +- datalad_metalad/filters/base.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index ea947964..06d99d81 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# simple makefile to simplify repetetive build env management tasks under posix +# simple makefile to simplify repetitive build env management tasks under posix # Ideas borrowed from scikit-learn's and PyMVPA Makefiles -- thanks! PYTHON ?= python diff --git a/_datalad_buildsupport/formatters.py b/_datalad_buildsupport/formatters.py index 5ac01de8..a88a99bd 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_metalad/__init__.py b/datalad_metalad/__init__.py index b4fd00e0..9fc8a929 100644 --- a/datalad_metalad/__init__.py +++ b/datalad_metalad/__init__.py @@ -78,7 +78,7 @@ def get_file_id(rec): Any ID string is prefixed with 'datalad:' to identify it as a DataLad-recognized ID. This prefix is defined in the main JSON-LD - context defintion. + context definition. """ from datalad.support.digests import Digester diff --git a/datalad_metalad/aggregate.py b/datalad_metalad/aggregate.py index 6262fcba..ee1f5539 100644 --- a/datalad_metalad/aggregate.py +++ b/datalad_metalad/aggregate.py @@ -397,7 +397,7 @@ def copy_to_existing(destination_metadata_store: str, # object, we have to read in the object after copying it # only, to write it out again. This is wasteful. We should # instead specify that the top-level object, here: the - # DatasetTree, is not writen out. + # DatasetTree, is not written out. copied_dataset_tree.read_in() root_dataset_tree.add_subtree( @@ -498,7 +498,7 @@ def copy_tree_version_list(destination_metadata_store: str, # object, we have to read in the object after copying it # only, to write it out again. This is wasteful. We should # instead specify that the top-level object, here: the - # DatasetTree, is not writen out. + # DatasetTree, is not written out. copied_dataset_tree.read_in() destination_tree_version_list.set_dataset_tree( diff --git a/datalad_metalad/extractors/core.py b/datalad_metalad/extractors/core.py index 41375b8e..5f598241 100644 --- a/datalad_metalad/extractors/core.py +++ b/datalad_metalad/extractors/core.py @@ -355,7 +355,7 @@ def _get_commit_info(ds, refcommit, status): ) ] # version, always anchored on the first commit (tags could move and - # make the integer commit count ambigous, and subtantially complicate + # make the integer commit count ambiguous, and subtantially complicate # version comparisons version = '0-{}-g{}'.format( len(commits), diff --git a/datalad_metalad/extractors/tests/test_base.py b/datalad_metalad/extractors/tests/test_base.py index 242e8b26..78584de4 100644 --- a/datalad_metalad/extractors/tests/test_base.py +++ b/datalad_metalad/extractors/tests/test_base.py @@ -103,7 +103,7 @@ def test_api(path=None, *, annex): "Should have managed to find at least the core extractor extractor" if skipped_extractors: pytest.skip( - "Not fully tested/succeded since some extractors failed" + "Not fully tested/succeeded since some extractors failed" " to load:\n%s" % ("\n".join(skipped_extractors))) diff --git a/datalad_metalad/filters/base.py b/datalad_metalad/filters/base.py index b8a67de9..73ffbf8d 100644 --- a/datalad_metalad/filters/base.py +++ b/datalad_metalad/filters/base.py @@ -38,7 +38,7 @@ def filter(self, This method is called by the 'meta-filter' driver. It should iterate through the metadata instances that are provided by the metadata - coordinates, perform the filter operation ond yield the resulting + coordinates, perform the filter operation one yield the resulting metadata objects as instances of "datalad_metalad.metadatatypes.Metadata". Returned metadata is emitted as datalad invocation result, e.g. as From 41c6c96121d8478de67f359b79e574ee1563908c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 28 Feb 2023 10:16:15 -0500 Subject: [PATCH 6/9] Test etc datalad_metalad not datalad in tox.ini --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 031d57af..12e7fce6 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ skip_install = true deps = codespell~=2.0 commands = - codespell -x .codespell-ignorelines -D- -I .codespell-ignorewords --skip "_version.py,*.pem" datalad setup.py + codespell -x .codespell-ignorelines -D- -I .codespell-ignorewords --skip "_version.py,*.pem" datalad_metalad setup.py [testenv:flake8] commands = flake8 {posargs} @@ -81,5 +81,5 @@ python_files = test_*.py *_test.py utils_pytest.py # W293 = Blank line contains whitespace #ignore = E265,W293,E266,E731 max-line-length = 120 -include = datalad +include = datalad_metalad exclude = .tox,.venv,venv-debug,build,dist,doc,git/ext/ From d1fca21eb91d5cd1946f674969ac10ca1b200397 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 28 Feb 2023 10:32:43 -0500 Subject: [PATCH 7/9] BF: declare that flake8 tox env needs flake8 --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 12e7fce6..31282bd7 100644 --- a/tox.ini +++ b/tox.ini @@ -24,6 +24,7 @@ commands = codespell -x .codespell-ignorelines -D- -I .codespell-ignorewords --skip "_version.py,*.pem" datalad_metalad setup.py [testenv:flake8] +deps = flake8 commands = flake8 {posargs} [testenv:venv] From 11932faa3e3dce78a43924b901dbe91d8778deca Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 28 Feb 2023 10:36:12 -0500 Subject: [PATCH 8/9] RF: no need for custom options for codespell invocation in tox.ini --- .codespellrc | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index 3694999d..52cf10a3 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,4 @@ [codespell] -skip = .git,*.pdf,*.svg,venvs,versioneer.py,_version.py +skip = .git,*.pdf,*.svg,venvs,versioneer.py,_version.py,.tox # mke -- is a variable name which makes sense, let's ignore for now until inline skips are supported ignore-words-list = mke diff --git a/tox.ini b/tox.ini index 31282bd7..c17616e4 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ skip_install = true deps = codespell~=2.0 commands = - codespell -x .codespell-ignorelines -D- -I .codespell-ignorewords --skip "_version.py,*.pem" datalad_metalad setup.py + codespell [testenv:flake8] deps = flake8 From b692ab9e884f16dbfc6d4dddb37a31a575025deb Mon Sep 17 00:00:00 2001 From: Adina Wagner Date: Tue, 28 Feb 2023 17:07:02 +0100 Subject: [PATCH 9/9] fix the last typo --- datalad_metalad/filters/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datalad_metalad/filters/base.py b/datalad_metalad/filters/base.py index 73ffbf8d..1b9d268b 100644 --- a/datalad_metalad/filters/base.py +++ b/datalad_metalad/filters/base.py @@ -38,7 +38,7 @@ def filter(self, This method is called by the 'meta-filter' driver. It should iterate through the metadata instances that are provided by the metadata - coordinates, perform the filter operation one yield the resulting + coordinates, perform the filter operation and yield the resulting metadata objects as instances of "datalad_metalad.metadatatypes.Metadata". Returned metadata is emitted as datalad invocation result, e.g. as