From 0df045bb5c285be8191ac1b61e1c665decbd365b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 26 Feb 2024 17:21:33 -0500 Subject: [PATCH 1/5] Add github action to codespell main 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 0000000..7c9eafb --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From 82544b7a1d5ef8a7475b099af2692e43c638941f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 26 Feb 2024 17:21:33 -0500 Subject: [PATCH 2/5] 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 0000000..cb0a37b --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git,*.svg,*.css,.codespellrc +check-hidden = true +# ignore-regex = +# ignore-words-list = From ebec08969352d77ba13c9d3e456a26f61f001c5e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 26 Feb 2024 17:21:33 -0500 Subject: [PATCH 3/5] Add pre-commit definition for codespell --- .pre-commit-config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2c685f6..7b836e4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,3 +54,10 @@ repos: # W605 - a backslash-character pair that is not a valid escape sequence now # generates a DeprecationWarning. This will eventually become a SyntaxError. # Needed because we use \d as an escape sequence + + # codespell + - repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in .codespellrc + rev: v2.2.6 + hooks: + - id: codespell From 8c6f5d9b61b5442f2e96d88b3946e3467f0be92c Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 26 Feb 2024 17:22:49 -0500 Subject: [PATCH 4/5] ignore ./cspell.json which demonstrates a typo to be fixed --- .codespellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codespellrc b/.codespellrc index cb0a37b..eb38789 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,6 @@ [codespell] # Ref: https://github.com/codespell-project/codespell#using-a-config-file -skip = .git,*.svg,*.css,.codespellrc +skip = .git,*.svg,*.css,.codespellrc,cspell.json check-hidden = true # ignore-regex = # ignore-words-list = From c4633e3a003b3d4e530ab8c11b9e0d87bd98766b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Mon, 26 Feb 2024 17:22:52 -0500 Subject: [PATCH 5/5] [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 ^^^ --- CHANGELOG.md | 2 +- element_interface/caiman_loader.py | 2 +- element_interface/extract_trigger.py | 4 ++-- element_interface/suite2p_loader.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7dfd0b..787b107 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and ## [0.6.1] - 2023-08-02 -+ Update DANDI upload funtionality to improve useability ++ Update DANDI upload functionality to improve usability ## [0.6.0] - 2023-07-26 diff --git a/element_interface/caiman_loader.py b/element_interface/caiman_loader.py index 3726afd..6d9e528 100644 --- a/element_interface/caiman_loader.py +++ b/element_interface/caiman_loader.py @@ -79,7 +79,7 @@ def __init__(self, caiman_dir: str): else: raise FileNotFoundError( "No CaImAn analysis output file found at {}" - " containg all required fields ({})".format( + " containing all required fields ({})".format( caiman_dir, _required_hdf5_fields ) ) diff --git a/element_interface/extract_trigger.py b/element_interface/extract_trigger.py index 103e3e0..a31068a 100644 --- a/element_interface/extract_trigger.py +++ b/element_interface/extract_trigger.py @@ -11,7 +11,7 @@ class EXTRACT_trigger: data = load('{scanfile}'); M = data.M; - % Input Paramaters + % Input Parameters config = struct(); {parameters_list_string} @@ -31,7 +31,7 @@ def __init__( Args: scanfile (Union[str, Path]): Full path of the scan - parameters (dict): EXTRACT input paramaters. + parameters (dict): EXTRACT input parameters. output_dir (Union[str, Path]): Directory to store the outputs of EXTRACT analysis. """ assert isinstance(parameters, dict) diff --git a/element_interface/suite2p_loader.py b/element_interface/suite2p_loader.py index 07dbff1..a6c2377 100644 --- a/element_interface/suite2p_loader.py +++ b/element_interface/suite2p_loader.py @@ -64,7 +64,7 @@ def __init__(self, suite2p_dir: str): self.creation_time = min( [p.creation_time for p in self.planes.values()] - ) # ealiest file creation time + ) # earliest file creation time self.curation_time = max( [p.curation_time for p in self.planes.values()] ) # most recent curation time