Skip to content

Commit

Permalink
Merge pull request #2969 from yarikoptic/enh-codespell
Browse files Browse the repository at this point in the history
Add codespell: workflow, config + get more typos fixed
  • Loading branch information
nellh authored Jan 16, 2024
2 parents 2f451f5 + e0627af commit aa10a1d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +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,.pnp.cjs
check-hidden = true
ignore-regex = ^.{300,}$|/((.*\|){4,}.*\))|\b(afterAll)\b
ignore-words-list = chack
23 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const CreateReviewLink: FC<CreateReviewLinkProps> = ({ datasetId }) => {
<div className="share-form-controls">
{error
? (
"An Error Occured"
"An Error Occurred"
)
: data
? (
Expand Down
4 changes: 2 additions & 2 deletions services/datalad/datalad_service/common/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aa10a1d

Please sign in to comment.