Skip to content

Commit 680789b

Browse files
Fix typos detected by the typos tool (#1330)
* typos: apply automatic corrections * typos: apply manual corrections * typos: run as linter * typos: apply automatic corrections in releasenotes/ * typos: also check releasenotes content * Add release notes fragment * workflows/main: add spell check * Fix docs build * typos: upgrade to 1.28 * workflows/main: pin rust to 1.82 * workflows/main: remove spell check * Use Rust stable again * Typos: dedicated nox command * Move typos configuration to pyproject.toml --------- Co-authored-by: Ivan Carvalho <[email protected]> Co-authored-by: Ivan Carvalho <[email protected]>
1 parent 5d28053 commit 680789b

File tree

74 files changed

+184
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+184
-166
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- run: pip install -U ruff==0.6.8 black~=24.8
3030
- uses: dtolnay/rust-toolchain@stable
3131
with:
32-
components: rustfmt
32+
components: rustfmt, clippy
3333
- name: Test Build
3434
run: cargo build
3535
- name: Rust Format

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ cargo doc --open
284284
### Type Annotations
285285
286286
If you have added new methods, functions, or classes, and/or changed any
287-
signatures, type anotations for Python are required to be included in a pull
287+
signatures, type annotations for Python are required to be included in a pull
288288
request. Type annotations are added using type
289289
[stub files](https://typing.readthedocs.io/en/latest/source/stubs.html) which
290290
provide type annotations to python tooling which use type annotations. The stub
@@ -523,7 +523,7 @@ primary exception to this is adding support for new python versions. If a new
523523
python version is released backporting that feature change with that new support
524524
is an acceptable backport.
525525
526-
In rustworkx at least until the 1.0 release we only maintaing a single stable
526+
In rustworkx at least until the 1.0 release we only maintain a single stable
527527
branch at a time for the most recent minor version release.
528528
529529
#### Backporting procedure

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ it just as it would if there was a prebuilt binary available.
7777
> [!NOTE]
7878
> To build from source you will need to ensure you have pip >=19.0.0
7979
installed, which supports PEP-517, or that you have manually installed
80-
`setuptools-rust` prior to running `pip install rustworkx`. If you recieve an
80+
`setuptools-rust` prior to running `pip install rustworkx`. If you receive an
8181
error about `setuptools-rust` not being found you should upgrade pip with
8282
`pip install -U pip` or manually install `setuptools-rust` with
8383
`pip install setuptools-rust` and try again.

docs/source/benchmarks.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Rustworkx Comparison Benchmarks With Other Libraries
33
****************************************************
44

5-
rustworkx is competitive against other popular graph libraries for Python. We compared rustworkx to the igraph, graph-tools and NetworkIt libraries `in a benchmark consisting of four tasks available on Github for reproducibility <https://github.com/mtreinish/retworkx-comparison-benchmarks>`__. We report the results from a machine with an Intel(R) i9-9900K CPU at 3.60GHz with eight cores, 16 theads, and 32GB of RAM avaialble.
5+
rustworkx is competitive against other popular graph libraries for Python. We compared rustworkx to the igraph, graph-tools and NetworkIt libraries `in a benchmark consisting of four tasks available on Github for reproducibility <https://github.com/mtreinish/retworkx-comparison-benchmarks>`__. We report the results from a machine with an Intel(R) i9-9900K CPU at 3.60GHz with eight cores, 16 threads, and 32GB of RAM available.
66

77
Graph Creation
88
==============

docs/source/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ just as it would if there was a prebuilt binary available.
4444

4545
To build from source you will need to ensure you have pip >=19.0.0
4646
installed, which supports PEP-517, or that you have manually installed
47-
setuptools-rust prior to running pip install rustworkx. If you recieve an
47+
setuptools-rust prior to running pip install rustworkx. If you receive an
4848
error about ``setuptools-rust`` not being found you should upgrade pip with
4949
``pip install -U pip`` or manually install ``setuptools-rust`` with:
5050
``pip install setuptools-rust`` and try again.
5151

52-
.. _platform-suppport:
52+
.. _platform-support:
5353

5454
Platform Support
5555
================

docs/source/release_notes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ New Features
266266

267267
- A new method, :meth:`~rustworkx.PyDiGraph.remove_node_retain_edges`, has been
268268
added to the :class:`~rustworkx.PyDiGraph` class. This method can be used to
269-
remove a node and add edges from its predecesors to its successors.
269+
remove a node and add edges from its predecessors to its successors.
270270
- Two new methods, :meth:`~rustworkx.PyGraph.edge_list` and
271271
:meth:`~rustworkx.PyGraph.weighted_edge_list`, for getting a list of tuples
272272
with the edge source and target (with or without edge weights) have been
@@ -285,7 +285,7 @@ New Features
285285
edge list file and will read that file and generate a new object from the
286286
contents.
287287
- Two new methods, :meth:`~rustworkx.PyGraph.extend_from_edge_list` and
288-
:meth:`~rustworkx.PyGraoh.extend_from_weighted_edge_list` has been added
288+
:meth:`~rustworkx.PyGraph.extend_from_weighted_edge_list` has been added
289289
to :class:`~rustworkx.PyGraph` and :class:`~rustworkx.PyDiGraph`
290290
(:meth:`~rustworkx.PyDiGraph.extend_from_edge_list` and
291291
:meth:`~rustworkx.PyDiGraph.extend_from_weighted_edge_list`). This method

docs/source/tutorial/betweenness_centrality.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ To start we need to generate a graph:
3737
mpl_draw(graph)
3838

3939

40-
Calculate the Betweeness Centrality
41-
-----------------------------------
40+
Calculate the Betweenness Centrality
41+
------------------------------------
4242

4343
The :func:`~rustworkx.betweenness_centrality` function can be used to calculate
4444
the betweenness centrality for each node in the graph.

docs/source/tutorial/dags.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs. For example:
113113
Above we define a DAG with 6 jobs and dependency relationship between these
114114
jobs. Now if we run the :func:`~rustworkx.topological_sort` function on the
115115
graph it will return a linear order to execute the jobs that will respect
116-
the dependency releationship.
116+
the dependency relationship.
117117

118118
.. jupyter-execute::
119119

@@ -151,7 +151,7 @@ computation. A quantum circuit is represented graphically like:
151151
152152
The specifics of this circuit aren't important here beyond the fact that
153153
we have 2 qubits, ``q_0`` and ``q_1``, 2 classical bits, ``c_0`` and ``c_1``,
154-
and a series of operations on those qubits with a depedency ordering. The last
154+
and a series of operations on those qubits with a dependency ordering. The last
155155
operation on each qubit is a measurement on ``q_0`` that is stored in ``c_0``
156156
and ``q_1`` that is stored in ``c_1``.
157157

noxfile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"black~=24.8",
1616
"ruff~=0.6",
1717
"setuptools-rust",
18+
"typos~=1.28",
1819
]
1920

2021
stubs_deps = [
@@ -45,6 +46,7 @@ def test_with_version(session):
4546
@nox.session(python=["3"])
4647
def lint(session):
4748
black(session)
49+
typos(session)
4850
session.install(*lint_deps)
4951
session.run("ruff", "check", "rustworkx", "retworkx", "setup.py")
5052
session.run("cargo", "fmt", "--all", "--", "--check", external=True)
@@ -69,6 +71,12 @@ def black(session):
6971
session.install(*[d for d in lint_deps if "black" in d])
7072
session.run("black", "rustworkx", "tests", "retworkx", *session.posargs)
7173

74+
@nox.session(python=["3"])
75+
def typos(session):
76+
session.install(*[d for d in lint_deps if "typos" in d])
77+
session.run("typos", "--exclude", "releasenotes")
78+
session.run("typos", "--no-check-filenames", "releasenotes")
79+
7280
@nox.session(python=["3"])
7381
def stubs(session):
7482
install_rustworkx(session)

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ extend-exclude = ["doc"]
2323
"rustworkx/__init__.py" = ["F405", "F403"]
2424
"*.pyi" = ["F403", "F405", "PYI001", "PYI002"]
2525

26+
[tool.typos.default]
27+
extend-ignore-words-re = [
28+
"[Ss]toer",
29+
]
30+
2631
[tool.cibuildwheel]
2732
manylinux-x86_64-image = "manylinux2014"
2833
manylinux-i686-image = "manylinux2014"

0 commit comments

Comments
 (0)