From 84abd667e6c7c6b36ebd6dddd8104702c08c305b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 12 Jan 2024 12:25:47 -0500 Subject: [PATCH 1/6] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 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 0000000000..daa4072c1a --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [master] + pull_request: + branches: [master] + +permissions: + contents: read + +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@v2 From a39a33df1d54dfef69be67798146a6119c2074a2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 12 Jan 2024 12:25:47 -0500 Subject: [PATCH 2/6] Add rudimentary codespell config --- .codespellrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..9c2d1d7a30 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +[codespell] +skip = .git,*.pdf,*.svg,go.sum,*.lock,.codespellrc +check-hidden = true +# ignore-regex = +# ignore-words-list = From c1a0a9fe44436bd63244501cd5c0934ab11263bf Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 12 Jan 2024 12:27:41 -0500 Subject: [PATCH 3/6] Try to ignore very long lines as something not to care about --- .codespellrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index 9c2d1d7a30..b07632acd0 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,6 @@ # Ref: https://github.com/codespell-project/codespell#using-a-config-file [codespell] -skip = .git,*.pdf,*.svg,go.sum,*.lock,.codespellrc +skip = .git,*.pdf,*.svg,go.sum,*.lock,.codespellrc,.yarn,node_modules check-hidden = true -# ignore-regex = +ignore-regex = ^.{300,}$ # ignore-words-list = From 62ff18fb595ecefd208a8e5b16accd0d9e12c034 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 12 Jan 2024 12:29:41 -0500 Subject: [PATCH 4/6] ignore some regexes, name and a variable --- .codespellrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.codespellrc b/.codespellrc index b07632acd0..b85d6f09bf 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,6 @@ # Ref: https://github.com/codespell-project/codespell#using-a-config-file [codespell] -skip = .git,*.pdf,*.svg,go.sum,*.lock,.codespellrc,.yarn,node_modules +skip = .git,*.pdf,*.svg,go.sum,*.lock,.codespellrc,.yarn,node_modules,schema-validator.js check-hidden = true -ignore-regex = ^.{300,}$ -# ignore-words-list = +ignore-regex = ^.{300,}$|/((.*\|){4,}.*\))|\b(afterAll)\b +ignore-words-list = chack From 0f0022334f6052b0e45a6c6a7a3656891f3e8228 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 12 Jan 2024 12:42:33 -0500 Subject: [PATCH 5/6] ignore .pnp.cjs -- autogenerated --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index b85d6f09bf..0309c9205d 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,6 @@ # Ref: https://github.com/codespell-project/codespell#using-a-config-file [codespell] -skip = .git,*.pdf,*.svg,go.sum,*.lock,.codespellrc,.yarn,node_modules,schema-validator.js +skip = .git,*.pdf,*.svg,go.sum,*.lock,.codespellrc,.yarn,node_modules,schema-validator.js,.pnp.cjs check-hidden = true ignore-regex = ^.{300,}$|/((.*\|){4,}.*\))|\b(afterAll)\b ignore-words-list = chack From e0627af77760b35db2895e4534f9994e30d4c46f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 12 Jan 2024 12:42:39 -0500 Subject: [PATCH 6/6] [DATALAD RUNCMD] run codespell throughout fixing typo automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- .../scripts/dataset/mutations/create-anonymous-reviewer.tsx | 2 +- services/datalad/datalad_service/common/git.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/openneuro-app/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx b/packages/openneuro-app/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx index af42c71aeb..34ac4f5ab5 100644 --- a/packages/openneuro-app/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx +++ b/packages/openneuro-app/src/scripts/dataset/mutations/create-anonymous-reviewer.tsx @@ -30,7 +30,7 @@ export const CreateReviewLink: FC = ({ datasetId }) => {
{error ? ( - "An Error Occured" + "An Error Occurred" ) : data ? ( diff --git a/services/datalad/datalad_service/common/git.py b/services/datalad/datalad_service/common/git.py index ea5bbae7e2..49a526a02e 100644 --- a/services/datalad/datalad_service/common/git.py +++ b/services/datalad/datalad_service/common/git.py @@ -14,9 +14,9 @@ class OpenNeuroGitError(Exception): """OpenNeuro git repo states that should not arise under normal use but may be a valid git operation in other contexts.""" -def git_show(path, commitish, obj): +def git_show(path, committish, obj): repo = pygit2.Repository(path) - commit, _ = repo.resolve_refish(commitish) + commit, _ = repo.resolve_refish(committish) data_bytes = (commit.tree / obj).read_raw() encoding = chardet.detect(data_bytes[0:4096])["encoding"] or 'utf-8' return data_bytes.decode(encoding)