Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve command line interface #25

Merged
merged 6 commits into from
Jul 5, 2023

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Jul 5, 2023

Summary

These changes were implemented following the integration of Slicer/Slicer#7063 contributed by @jhlegarreta. These are intended to streamline the integration of project already using the checker provided by "codespell-project".

  • By default, search files in current directory
  • Initialize default list of suffixes
  • Clarify --dict help string, and support --ignore-words and -I alternative
  • Add support for excluding files specifying glob patterns
  • Improve help string associated with the --exclude argument
  • Add regular Python docstrings

Use in Slicer

mkvirtualenv codespell
python -m pip install git+https://github.com/jcfr/SimpleITKSpellChecking@improve-command-line-interface

Then apply this patch

diff --git a/Utilities/Scripts/runCodespell.sh b/Utilities/Scripts/runCodespell.sh
index 6cfe638836..283606868d 100755
--- a/Utilities/Scripts/runCodespell.sh
+++ b/Utilities/Scripts/runCodespell.sh
@@ -33,4 +33,5 @@ if [[ ! -e ${ignore_words_file} ]]; then
   exit 1
 fi
 
-codespell -w -q6 --skip="${skip}" -I ${ignore_words_file}
+codespell --skip="${skip}" -I ${ignore_words_file} \
+  --miss --verbose --prefix "vtkSlicer" --prefix "qSlicer" --prefix "vtkITK" --prefix "qMRML" --prefix "vtkMRML"

.. and run the script:

/path/to/Slicer/Utilities/Scripts/runCodespell.sh

cc: @lassoan @jamesobutler

jcfr added 6 commits July 4, 2023 18:28
This is intended to streamline the integration of project already using
the checker provided by "codespell-project".
…ternative

This is intended to streamline the integration of project already using
the checker provided by "codespell-project".
Copy link
Member

@dave3d dave3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for these improvements.

@dave3d dave3d merged commit 82bcb09 into SimpleITK:main Jul 5, 2023
Copy link
Contributor

@jhlegarreta jhlegarreta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being late. A few comments about docstrings. Thanks for doing this @jcfr.

codespell.py Show resolved Hide resolved
codespell.py Show resolved Hide resolved
codespell.py Show resolved Hide resolved
codespell.py Show resolved Hide resolved
codespell.py Show resolved Hide resolved
@jcfr jcfr deleted the improve-command-line-interface branch July 5, 2023 21:08
@jcfr
Copy link
Contributor Author

jcfr commented Jul 5, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants