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 = 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 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 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/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: 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