From db9d738bad41179743b8ea84415934c0b6a533df Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 18 Apr 2024 14:32:10 -0400 Subject: [PATCH 1/3] Add github action to codespell master 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..eeacead --- /dev/null +++ b/.github/workflows/codespell.yml @@ -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@v4 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From f9626158f2b6109f698b1ec0a55429036f94eea6 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 18 Apr 2024 14:32:10 -0400 Subject: [PATCH 2/3] 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..f3d93d7 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,.codespellrc,testdata,config.json +check-hidden = true +# ignore-regex = +# ignore-words-list = From 8f46e4313037d5532abbf6ae42a5ec99a08672a2 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 18 Apr 2024 14:32:51 -0400 Subject: [PATCH 3/3] [DATALAD RUNCMD] run codespell throughout fixing typos automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- README.md | 4 ++-- hooks/bl2bids.py | 4 ++-- hooks/direct/status | 2 +- hooks/pbs/start | 2 +- hooks/slurm/status | 2 +- hooks/smon | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 40b2676..3ec065d 100644 --- a/README.md +++ b/README.md @@ -113,7 +113,7 @@ Start script can output startup log to stdout, or any error messages to stderr. This script will be executed by workflow manager periodically to query status of the application. You can simply check for the PID of the application to make sure that it's running, or for a batch system, you can use commands such as `qstat` or `condor_status` to query for your application. -Please see [ABCD default hook scritps](https://github.com/brain-life/abcd-spec/tree/master/hooks) as an example. +Please see [ABCD default hook scripts](https://github.com/brain-life/abcd-spec/tree/master/hooks) as an example. #### Exit Code @@ -229,7 +229,7 @@ SERVICE_BRANCH: Name of the service branch (if specified by the user) ### Workflow directory -ABCD workflow manager should git clones requested service on remote resource's scratch space as a new work directory for each task and set the current directory to that directory prior to executing ABCD hooks. Application can therefore expect to find all files that are distributed via the specifed github repository (with `--depth 1` to omit git history, however). +ABCD workflow manager should git clones requested service on remote resource's scratch space as a new work directory for each task and set the current directory to that directory prior to executing ABCD hooks. Application can therefore expect to find all files that are distributed via the specified github repository (with `--depth 1` to omit git history, however). ### Input Parameters (config.json) diff --git a/hooks/bl2bids.py b/hooks/bl2bids.py index 544fde5..a5cdca0 100755 --- a/hooks/bl2bids.py +++ b/hooks/bl2bids.py @@ -83,7 +83,7 @@ name+="_task-id%d" %(id+1) #meta contains both acq and acquisition set to different value - #I am not sure why, but let's make acqusition take precedence + #I am not sure why, but let's make acquisition take precedence acq = None if "acquisition" in input["meta"]: acq = utils.clean(input["meta"]["acquisition"]) @@ -370,7 +370,7 @@ utils.outputSidecar(dest+"_eeg.json", input) else: - #others are considered delivatives and the entire files/dirs will be copied over + #others are considered derivatives and the entire files/dirs will be copied over for key in input["keys"]: print("..", key) base = os.path.basename(config[key]) diff --git a/hooks/direct/status b/hooks/direct/status index 624f3ae..ba7fa8c 100755 --- a/hooks/direct/status +++ b/hooks/direct/status @@ -20,7 +20,7 @@ function check_exit() #echo "finished with exit code $code" logfile=$(ls -rt *.log | tail -1) tail -10 $logfile | grep -v -e '^$' | tail -1 - exit 2 #faild! + exit 2 #failed! fi } check_exit diff --git a/hooks/pbs/start b/hooks/pbs/start index 7d271f9..fbe8eb0 100755 --- a/hooks/pbs/start +++ b/hooks/pbs/start @@ -59,7 +59,7 @@ else echo "./$main" >> _main fi echo "echo \$? > exit-code" >> _main -chmod +x $main #in case user fogets it +chmod +x $main #in case user forgets it echo "kill \$smonpid" >> _main diff --git a/hooks/slurm/status b/hooks/slurm/status index e0fcad9..dc2c54f 100755 --- a/hooks/slurm/status +++ b/hooks/slurm/status @@ -80,7 +80,7 @@ if [ $jobstate == "RUNNING" ]; then fi echo $jobstate -if [ $jobstate == "COMPLETEING" ]; then +if [ $jobstate == "COMPLETING" ]; then exit 0 fi if [ $jobstate == "CONFIGURING" ]; then diff --git a/hooks/smon b/hooks/smon index 54a1a4a..520ccda 100755 --- a/hooks/smon +++ b/hooks/smon @@ -33,7 +33,7 @@ with open(name, "w") as outfile: if "PBS_NUM_PPN" in os.environ: max_ppn = int(os.environ["PBS_NUM_PPN"]) #from https://slurm.schedmd.com/srun.html - if "SLURM_CPUS_ON_NODE" in os.environ: #incase SLURM_NTASKS is not set? + if "SLURM_CPUS_ON_NODE" in os.environ: #in case SLURM_NTASKS is not set? max_ppn = int(os.environ["SLURM_CPUS_ON_NODE"]) if "SLURM_NTASKS" in os.environ: max_ppn = int(os.environ["SLURM_NTASKS"]) @@ -96,7 +96,7 @@ with open(name, "w") as outfile: #dump info that doesn't change on the first entry json.dump({ "time": time.time(), - "uname": os.uname(), #os/kernerl/hostname version + "uname": os.uname(), #os/kernel/hostname version "cpu_total": os.sysconf('SC_NPROCESSORS_CONF'), "cpu_requested": max_ppn,