From 8cc459fad24612c4e6f30862a55a70d74a355116 Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Tue, 18 Oct 2022 01:40:22 +0200 Subject: [PATCH] CI: implement codespell check for custom word mappings (#1322) * subdir -> sub-dir: use hyphen * forgot some, now complete * sub-dir -> subdir, without hyphen * try codespell without gh action * fix reqs * try custom directory * more codespell tests * fix config * folder -> directory, and other fixes * more fixes * ignore .git * fix flake8, do not touch ipynb * use codespell config and gh action * Update .codespell_dict * try feeding a config * try if config is parsed regardless * fix again, codespell works * test plurals * plurals dont seem to work auto, so add to dict * add codespell to pre-commit hooks --- .codespell_dict | 6 ++++++ .codespellrc | 6 ++++++ .github/workflows/validation.yml | 3 --- .pre-commit-config.yaml | 4 ++++ src/02-common-principles.md | 10 +++++----- .../01-magnetic-resonance-imaging-data.md | 16 ++++++++-------- .../02-magnetoencephalography.md | 12 ++++++------ .../03-electroencephalography.md | 10 +++++----- .../04-intracranial-electroencephalography.md | 10 +++++----- .../07-behavioral-experiments.md | 2 +- .../09-positron-emission-tomography.md | 4 ++-- src/04-modality-specific-files/10-microscopy.md | 4 ++-- src/appendices/file-collections.md | 4 ++-- src/schema/objects/extensions.yaml | 16 ++++++++-------- tools/schemacode/bidsschematools/render/text.py | 2 +- .../bidsschematools/tests/test_rules.py | 2 +- 16 files changed, 62 insertions(+), 49 deletions(-) create mode 100644 .codespell_dict create mode 100644 .codespellrc diff --git a/.codespell_dict b/.codespell_dict new file mode 100644 index 0000000000..81adf22162 --- /dev/null +++ b/.codespell_dict @@ -0,0 +1,6 @@ +sub-directory->subdirectory +sub-directories->subdirectories +file name->filename +file names->filenames +folder->directory +folders->directories diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000000..28aeafee0c --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +skip = *.js,*.svg,*.eps,.git +ignore-words-list = fo,te,als +builtin = clear,rare +dictionary = .codespell_dict +exclude-file = src/CHANGES.md diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 0492f0190b..91ba4d49e0 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -18,9 +18,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: codespell-project/actions-codespell@master - with: - skip: js,*.svg,*.eps - ignore_words_list: fo,te,als # Markdown formatting remark: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 16a07dd2ee..769560ee89 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,3 +12,7 @@ repos: - id: check-ast - id: check-added-large-files - id: check-case-conflict + - repo: https://github.com/codespell-project/codespell + rev: v2.2.2 + hooks: + - id: codespell diff --git a/src/02-common-principles.md b/src/02-common-principles.md index 4844c1415e..177384bb3f 100644 --- a/src/02-common-principles.md +++ b/src/02-common-principles.md @@ -86,7 +86,7 @@ instead of specified with an `n/a` value, or included as an empty file ## Filesystem structure -Data for each subject are placed in sub-directories named "`sub-