From 5ef90a2cfd00af76de1398c82987a5ea4b55009d Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 09:56:05 -0400 Subject: [PATCH 1/5] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 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..b026c85 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# 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: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From d5926809e3c7b83139c14f2cb5146b1f6a21651b Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 09:56:05 -0400 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..97a115e --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,*.svg,.codespellrc +check-hidden = true +# ignore-regex = +# ignore-words-list = From 3b2393e5e218dc1a7fbbf2abd6bba18e712faff8 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 09:56:05 -0400 Subject: [PATCH 3/5] Add pre-commit definition for codespell --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c88752..fad4de5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,3 +11,9 @@ repos: rev: 5.10.1 hooks: - id: isort + + - repo: https://github.com/codespell-project/codespell + # Configuration for codespell is in .codespellrc + rev: v2.3.0 + hooks: + - id: codespell From ca6043d5372581f4437ec3c8741ce6797cc02ed1 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 09:57:06 -0400 Subject: [PATCH 4/5] Fix forth typo --- docs/source/tutorials/composing_multipanel_figures.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/tutorials/composing_multipanel_figures.rst b/docs/source/tutorials/composing_multipanel_figures.rst index 4ed78c0..374a486 100644 --- a/docs/source/tutorials/composing_multipanel_figures.rst +++ b/docs/source/tutorials/composing_multipanel_figures.rst @@ -158,7 +158,7 @@ chained: ) It's often difficult to arrange the figures correctly and it can involve mundane -going back and fro between the code and generated SVG file. To ease the process +going back and forth between the code and generated SVG file. To ease the process ``compose`` offers several helper objects: The ``Grid()`` object generates a grid of horizontal and vertical lines labelled with their position in pixel units. To add it simply list ``Grid()`` as one of ``Figure()`` elements: From f63bb6af741ac3158631cb9c5ae13a0d4936940f Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 09:57:08 -0400 Subject: [PATCH 5/5] [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 ^^^ --- CONTRIBUTING.rst | 2 +- README.rst | 4 ++-- docs/source/getting_started.rst | 4 ++-- docs/source/tutorials/publication_quality_figures.rst | 2 +- src/svgutils/transform.py | 2 +- tests/test_compose.py | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 3cfe5c5..309ae48 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -4,7 +4,7 @@ Make sure to included the following with your PR: * short description of the contribution (in the Github form) * unit tests for the code that you implemented -* docummentation of new functions, classes etc. +* documentation of new functions, classes etc. You can also fix some the issues in the github tracker. If you decide to work on it, make sure to add a comment diff --git a/README.rst b/README.rst index d80b6a6..1013dfb 100644 --- a/README.rst +++ b/README.rst @@ -28,7 +28,7 @@ You can install `svgutils` from Python Package Index (PyPI) using the `pip3` uti pip3 install svgutils --user Note that the `pip3` will attempt to install `lxml` library if it is not already installed. -For the installation to be sucessful, you need development libraries of `libxml2` and `libxslt1`. +For the installation to be successful, you need development libraries of `libxml2` and `libxslt1`. On Ubuntu and other Debian-derived Linux distributions you can install them via:: sudo apt-get install libxml2-dev libxslt-dev @@ -50,7 +50,7 @@ If you don't want to add the channel to your configuration, you can specify it a From sources ```````````` -To install system-wide (needs administrator privilages):: +To install system-wide (needs administrator privileges):: python3 setup.py install diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 099ac9d..c08df8c 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -15,7 +15,7 @@ You can install `svgutils` from Python Package Index (PyPI) using the `pip3` uti pip3 install svgutils --user Note that the `pip3` will attempt to install `lxml` library if it is not already installed. -For the installation to be sucessful, you need development libraries of `libxml2` and `libxslt1`. +For the installation to be successful, you need development libraries of `libxml2` and `libxslt1`. On Ubuntu and other Debian-derived Linux distributions you can install them via:: sudo apt-get install libxml2-dev libxslt-dev @@ -37,7 +37,7 @@ If you don't want to add the channel to your configuration, you can specify it a From sources ```````````` -To install system-wide (needs administrator privilages):: +To install system-wide (needs administrator privileges):: python3 setup.py install diff --git a/docs/source/tutorials/publication_quality_figures.rst b/docs/source/tutorials/publication_quality_figures.rst index c0e78e7..246855e 100644 --- a/docs/source/tutorials/publication_quality_figures.rst +++ b/docs/source/tutorials/publication_quality_figures.rst @@ -59,7 +59,7 @@ which completely resides on Python tools is given here. `_. The basic operations are similar to what one would do in a vector - graphics editor but using scripts instead of a mouse cursor. This reduces repitition as one will not have to repeat the process when, + graphics editor but using scripts instead of a mouse cursor. This reduces repetition as one will not have to repeat the process when, for some reason, one needs to modify the plots they generated with matplotlib (to add more data or modify the parameters of the existing analysis, for example). diff --git a/src/svgutils/transform.py b/src/svgutils/transform.py index 0fde2b2..734da51 100644 --- a/src/svgutils/transform.py +++ b/src/svgutils/transform.py @@ -185,7 +185,7 @@ def __init__( class ImageElement(FigureElement): """Inline image element. - Correspoonds to SVG ```` tag. Image data encoded as base64 string. + Corresponds to SVG ```` tag. Image data encoded as base64 string. """ def __init__(self, stream, width, height, format="png"): diff --git a/tests/test_compose.py b/tests/test_compose.py index 6b52403..9318bc2 100644 --- a/tests/test_compose.py +++ b/tests/test_compose.py @@ -61,7 +61,7 @@ def test_units(): def test_unit_div(): - """test divding a number with unit by a number""" + """test dividing a number with unit by a number""" length = Unit("10cm") shorter_length = length / 2