Skip to content

Commit

Permalink
CI: implement codespell check for custom word mappings (#1322)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sappelhoff authored Oct 17, 2022
1 parent 669ab32 commit 8cc459f
Show file tree
Hide file tree
Showing 16 changed files with 62 additions and 49 deletions.
6 changes: 6 additions & 0 deletions .codespell_dict
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sub-directory->subdirectory
sub-directories->subdirectories
file name->filename
file names->filenames
folder->directory
folders->directories
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 5 additions & 5 deletions src/02-common-principles.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,25 +86,25 @@ 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-<label>`",
Data for each subject are placed in subdirectories named "`sub-<label>`",
where string "`<label>`" is substituted with the unique identification
label of each subject.
Additional information on each participant MAY be provided in a
[participants file](03-modality-agnostic-files.md#participants-file)
in the root directory of the dataset.

If data for the subject were acquired across multiple sessions, then within
the subject directory resides sub-directories named "`ses-<label>`",
the subject directory resides subdirectories named "`ses-<label>`",
where string "`<label>`" is substituted with a unique identification
label for each session.
In datasets where at least one subject has more than one session, this
additional sub-directory later SHOULD be added for all subjects in the dataset.
additional subdirectory later SHOULD be added for all subjects in the dataset.
Additional information on each session MAY be provided in a
[sessions file](03-modality-agnostic-files.md#sessions-file)
within the subject directory.

Within the session sub-directory (or the subject sub-directory if no
session sub-directories are present) are sub-directories named according to
Within the session subdirectory (or the subject subdirectory if no
session subdirectories are present) are subdirectories named according to
data type as defined above.
A data type directory SHOULD NOT be defined if there are no files to be placed
in that directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ whenever possible. See also

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -359,7 +359,7 @@ and a guide for using macros can be found at

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -567,7 +567,7 @@ and a guide for using macros can be found at

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -777,7 +777,7 @@ and can be used for practical guidance when curating a new dataset.

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -1009,7 +1009,7 @@ containing that type of fieldmap can be found here:

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -1055,7 +1055,7 @@ second echos are available.

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -1091,7 +1091,7 @@ In some cases (for example GE), the scanner software will directly reconstruct a

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -1140,7 +1140,7 @@ AFNI `3dqwarp`.

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down
12 changes: 6 additions & 6 deletions src/04-modality-specific-files/02-magnetoencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ the [BIDS examples repository](https://github.com/bids-standard/bids-examples).

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -203,7 +203,7 @@ Date time information MUST be expressed as indicated in [Units](../02-common-pri

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -287,7 +287,7 @@ UADC001 AUDIO V envelope of audio signal presented to participant

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -400,7 +400,7 @@ Photos of the anatomical landmarks and/or head localization coils

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand All @@ -427,7 +427,7 @@ actual anatomical nasion: `sub-0001_ses-001_acq-NAS_photo.jpg`

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -510,7 +510,7 @@ A guide for using macros can be found at

Example 2:

One recording per session, stored within the session folder.
One recording per session, stored within the session directory.

<!-- This block generates a file tree.
A guide for using macros can be found at
Expand Down
10 changes: 5 additions & 5 deletions src/04-modality-specific-files/03-electroencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and can be used for practical guidance when curating a new dataset.

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -183,7 +183,7 @@ Date time information MUST be expressed as indicated in [Units](../02-common-pri

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -258,7 +258,7 @@ UADC001 MISC n/a envelope of audio signal n/a good n/a

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -305,7 +305,7 @@ the recording.

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -423,7 +423,7 @@ Photos of the anatomical landmarks and/or fiducials.

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ and can be used for practical guidance when curating a new dataset.

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -203,7 +203,7 @@ Date time information MUST be expressed as indicated in [Units](../02-common-pri

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -276,7 +276,7 @@ Example of free-form text for field `description`:

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -350,7 +350,7 @@ H01 27 -42 -21 5 AdTech

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -430,7 +430,7 @@ Example:

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ In this example, tracer injection coincides with scan start.

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -296,7 +296,7 @@ ses-02 59

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down
4 changes: 2 additions & 2 deletions src/04-modality-specific-files/10-microscopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Further Microscopy datasets are available:

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -433,7 +433,7 @@ in a sample.

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down
4 changes: 2 additions & 2 deletions src/appendices/file-collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ included in this appendix:

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down Expand Up @@ -59,7 +59,7 @@ and a guide for using macros can be found at

<!--
This block generates a filename templates.
The inputs for this macro can be found in the folder
The inputs for this macro can be found in the directory
src/schema/rules/datatypes
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
Expand Down
16 changes: 8 additions & 8 deletions src/schema/objects/extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ chn:
A file generated by KRISS MEG systems containing the position of the center of the MEG coils.
Each experimental run on the KRISS system produces a file with extension `.kdf`.
Additional files that may be available in the same folder include
Additional files that may be available in the same directory include
the digitized positions of the head points (`\_digitizer.txt`),
the position of the center of the MEG coils (`.chn`),
and the event markers (`.trg`).
Expand All @@ -70,9 +70,9 @@ dat:
A fine-calibration file used for Neuromag/Elekta/MEGIN MEG recording hardware.
CTF:
value: .ds/
display_name: CTF MEG Dataset Folder
display_name: CTF MEG Dataset Directory
description: |
A folder for MEG data, typically containing a `.meg4` file for the data and a `.res4` file for the resources.
A directory for MEG data, typically containing a `.meg4` file for the data and a `.res4` file for the resources.
dlabelnii:
value: .dlabel.nii
display_name: CIFTI-2 Dense Label File
Expand Down Expand Up @@ -132,7 +132,7 @@ kdf:
A KRISS (file with extension `.kdf`) file.
Each experimental run on the KRISS system produces a file with extension `.kdf`.
Additional files that may be available in the same folder include
Additional files that may be available in the same directory include
the digitized positions of the head points (`\_digitizer.txt`),
the position of the center of the MEG coils (`.chn`),
and the event markers (`.trg`).
Expand All @@ -152,7 +152,7 @@ mefd:
value: .mefd/
display_name: Multiscale Electrophysiology File Format Version 3.0
description: |
A folder in the [MEF3](https://osf.io/e3sf9/) format.
A directory in the [MEF3](https://osf.io/e3sf9/) format.
Each recording consists of a `.mefd` directory.
mhd:
Expand Down Expand Up @@ -263,7 +263,7 @@ trg:
A file generated by KRISS MEG systems containing the event markers.
Each experimental run on the KRISS system produces a file with extension `.kdf`.
Additional files that may be available in the same folder include
Additional files that may be available in the same directory include
the digitized positions of the head points (`\_digitizer.txt`),
the position of the center of the MEG coils (`.chn`),
and the event markers (`.trg`).
Expand Down Expand Up @@ -312,7 +312,7 @@ None:
A file with no extension.
Directory:
value: /
display_name: Folder
display_name: Directory
description: |
A folder with no extension.
A directory with no extension.
Corresponds to BTi/4D data.
Loading

0 comments on commit 8cc459f

Please sign in to comment.