Skip to content

Commit

Permalink
codespell: workflow and some typos fixed (#176)
Browse files Browse the repository at this point in the history
* Add github action to codespell main on push and PRs

* Add rudimentary codespell config

* Add pre-commit definition for codespell

* [DATALAD RUNCMD] Do interactive fixing of some ambigous typos

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w -i 3 -C 2 ./tests/tests_integration/test_ssh_file_transfer.py",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

* [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 ^^^

* Fix formatting of .pre-commit-config.yaml
  • Loading branch information
yarikoptic authored Sep 20, 2023
1 parent 3b08874 commit 39fdbba
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 8 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
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@v3
- name: Codespell
uses: codespell-project/actions-codespell@v2
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ repos:
- types-appdirs
- types-paramiko
- types-simplejson
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
additional_dependencies:
- tomli
2 changes: 1 addition & 1 deletion datashuttle/command_line_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ def main() -> None:
should match the datashuttle API function name.
Next, initialise a datashuttle project using the API.
Supress the warning that a config file must
Suppress the warning that a config file must
be made on project initialisation when
a config is being made.
Expand Down
2 changes: 1 addition & 1 deletion datashuttle/datashuttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def upload(
data type folder to upload.
ses_names :
a session name / list of session names, similar to
sub_names but requring a "ses-" prefix.
sub_names but requiring a "ses-" prefix.
dry_run :
perform a dry-run of upload. This will output as if file
transfer was taking place, but no files will be moved. Useful
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"substitution",
"tasklist",
]
# Automatically add achors to markdown headings
# Automatically add anchors to markdown headings
myst_heading_anchors = 3

# Add any paths that contain templates here, relative to this directory.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/pages/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ To discuss, contribute or give feedback on DataShuttle, please check out our dis

## Python API Guide

DataShuttle can be used through the command line interface (as exampled in the *Get Started* section) or through a Python API. All commands shown in the *Get Started* guide can be used similarly in the Python API (with hypens replaced by underscores).
DataShuttle can be used through the command line interface (as exampled in the *Get Started* section) or through a Python API. All commands shown in the *Get Started* guide can be used similarly in the Python API (with hyphens replaced by underscores).

To start a project in Python, import DataShuttle and initialise the project class:

Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,8 @@ ignore = [

[project.scripts]
datashuttle = "datashuttle.command_line_interface:main"

[tool.codespell]
skip = '.git,*.pdf,*.svg'
#
# ignore-words-list = ''
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
FILESYSTEM_PATH and SERVER_PATH these must point
to the same folder on the HPC, filesystem,
as a moutned drive and server as the linux path to
as a mounted drive and server as the linux path to
connect through SSH
"""
import platform
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def get_top_level_folder_path(

assert (
folder_name in canonical_folders.get_top_level_folders()
), "folder_name must be cannonical e.g. rawdata"
), "folder_name must be canonical e.g. rawdata"

if local_or_central == "local":
base_path = project.cfg["local_path"]
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_integration/test_command_line_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def test_multiple_inputs(self, command):
"""
To process lists, a syntax "<>" is used
to specify input is list. Check the passed
varialbes are processed as expected.
variables are processed as expected.
"""
stdout, stderr = test_utils.run_cli(
f"{command} "
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_integration/test_ssh_file_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_all_data_transfer_options(
):
"""
Parse the arguments to filter the pathtable, getting
the files expected to be transferred pased on the arguments
the files expected to be transferred passed on the arguments
Note files in sub/ses/datatype folders must be handled
separately to those in non-sub, non-ses, non-data-type folders
Expand Down

0 comments on commit 39fdbba

Please sign in to comment.