Skip to content

Add codespell support (config, workflow to detect/not fix) and make it fix few typos #132

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -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 =
25 changes: 25 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorials/composing_multipanel_figures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/source/tutorials/publication_quality_figures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ which completely resides on Python tools is given here.
<https://github.com/btel/svg_utils>`_.

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).
Expand Down
2 changes: 1 addition & 1 deletion src/svgutils/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def __init__(
class ImageElement(FigureElement):
"""Inline image element.

Correspoonds to SVG ``<image>`` tag. Image data encoded as base64 string.
Corresponds to SVG ``<image>`` tag. Image data encoded as base64 string.
"""

def __init__(self, stream, width, height, format="png"):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down