Skip to content

Commit 131e7b4

Browse files
ci: add spellchecking (#6297)
1 parent e53b92a commit 131e7b4

Some content is hidden

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

73 files changed

+616
-282
lines changed

.github/workflows/ci.yml

+20
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
- check-external-types
7272
- check-fuzzing
7373
- check-unstable-mt-counters
74+
- check-spelling
7475
steps:
7576
- run: exit 0
7677

@@ -994,3 +995,22 @@ jobs:
994995
- name: Check /tokio-stream/
995996
run: cargo fuzz check --all-features
996997
working-directory: tokio-stream
998+
999+
check-spelling:
1000+
name: check-spelling
1001+
needs: basics
1002+
runs-on: ubuntu-latest
1003+
steps:
1004+
- uses: actions/checkout@v4
1005+
- name: Install Rust ${{ env.rust_stable }}
1006+
uses: dtolnay/rust-toolchain@stable
1007+
with:
1008+
toolchain: ${{ env.rust_stable }}
1009+
- name: Install cargo-spellcheck
1010+
uses: taiki-e/install-action@v2
1011+
with:
1012+
tool: cargo-spellcheck
1013+
- uses: actions/checkout@v4
1014+
- name: Run cargo-spellcheck
1015+
run: cargo spellcheck --code 1
1016+

CONTRIBUTING.md

+18
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,24 @@ MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-tag-raw-pointers" \
194194
cargo +nightly miri test --features full --lib
195195
```
196196

197+
### Performing spellcheck on tokio codebase
198+
199+
You can perform spell-check on tokio codebase. For details of how to use the spellcheck tool, feel free to visit
200+
https://github.com/drahnr/cargo-spellcheck
201+
```
202+
# First install the spell-check plugin
203+
cargo install --locked cargo-spellcheck
204+
205+
# Then run the cargo spell check command
206+
cargo spellcheck check
207+
```
208+
209+
if the command rejects a word, you should backtick the rejected word if it's code related. If not, the
210+
rejected word should be put into `spellcheck.dic` file.
211+
212+
Note that when you add a word into the file, you should also update the first line which tells the spellcheck tool
213+
the total number of words included in the file
214+
197215
### Tests
198216

199217
If the change being proposed alters code (as opposed to only documentation for

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ members = [
1414
"tests-build",
1515
"tests-integration",
1616
]
17+
18+
[workspace.metadata.spellcheck]
19+
config = "spellcheck.toml"
20+

spellcheck.dic

+279
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
279
2+
\
3+
~
4+
~4
5+
~12
6+
±1m
7+
±1ms
8+
9+
&
10+
+
11+
0o777
12+
0s
13+
0xA
14+
0xD
15+
100ms
16+
10ms
17+
1ms
18+
1s
19+
250ms
20+
2x
21+
443
22+
450ms
23+
50ms
24+
8MB
25+
<
26+
=
27+
>
28+
adaptor
29+
adaptors
30+
Adaptors
31+
AIO
32+
ambiant
33+
amongst
34+
api
35+
APIs
36+
async
37+
awaitable
38+
backend
39+
backpressure
40+
backtrace
41+
backtraces
42+
backtracing
43+
binded
44+
bitfield
45+
bitfields
46+
Blockingly
47+
boolean
48+
broadcasted
49+
cancelled
50+
cancelling
51+
Cancelling
52+
CLI
53+
cloneable
54+
codebase
55+
codec
56+
codecs
57+
combinator
58+
combinators
59+
Config
60+
config
61+
connectionless
62+
cpu
63+
cpus
64+
Customizable
65+
Datagram
66+
datagram
67+
datagrams
68+
deallocate
69+
deallocated
70+
Deallocates
71+
decrementing
72+
dequeued
73+
deregister
74+
deregistered
75+
deregistering
76+
Deregisters
77+
deregisters
78+
deregistration
79+
descriptor's
80+
destructor
81+
destructors
82+
destructure
83+
Destructures
84+
Dev
85+
dns
86+
DNS
87+
DoS
88+
dwOpenMode
89+
endian
90+
enqueue
91+
enqueued
92+
EntryInner
93+
enum
94+
eof
95+
errored
96+
EWMA
97+
expirations
98+
fcntl
99+
fd's
100+
FIFOs
101+
filename
102+
filesystem
103+
filesystems
104+
fn
105+
fns
106+
FreeBSD
107+
frontend
108+
fs
109+
functionalities
110+
getters
111+
GID
112+
Growable
113+
gzip
114+
hashmaps
115+
HashMaps
116+
hashsets
117+
ie
118+
Illumos
119+
impl
120+
implementers
121+
implementor
122+
implementors
123+
incrementing
124+
interoperate
125+
Invariants
126+
invariants
127+
io
128+
IOCP
129+
iOS
130+
IOs
131+
IP
132+
IPv4
133+
IPv6
134+
iteratively
135+
latencies
136+
Lauck
137+
libc
138+
lifecycle
139+
lifo
140+
lookups
141+
macOS
142+
MacOS
143+
Marsaglia's
144+
metadata
145+
mio
146+
Mio
147+
mio's
148+
misconfigured
149+
mock's
150+
mpmc
151+
mpsc
152+
Multi
153+
multi
154+
multicast
155+
Multithreaded
156+
mut
157+
mutex
158+
Mutex
159+
Nagle
160+
nonblocking
161+
nondecreasing
162+
noop
163+
ntasks
164+
ok
165+
oneshot
166+
ORed
167+
os
168+
overweighing
169+
parker
170+
parsers
171+
peekable
172+
PGID
173+
PID
174+
plaintext
175+
poller
176+
POSIX
177+
proxied
178+
qos
179+
RAII
180+
reallocations
181+
recv's
182+
refactors
183+
refcount
184+
refcounting
185+
repo
186+
repr
187+
representable
188+
reqwest
189+
reregistering
190+
resize
191+
resized
192+
RMW
193+
runtime
194+
runtimes
195+
runtime's
196+
rwlock
197+
rx
198+
scalability
199+
scheduler's
200+
semver
201+
setpgid
202+
sharded
203+
signalled
204+
signalling
205+
SmallCrush
206+
Solaris
207+
spawner
208+
Splitter
209+
spmc
210+
spsc
211+
src
212+
stabilised
213+
startup
214+
stateful
215+
stderr
216+
stdin
217+
stdout
218+
stealable
219+
stealer
220+
stealers
221+
struct
222+
structs
223+
subfield
224+
suboptimal
225+
subprocess
226+
superset
227+
symlink
228+
symlinks
229+
sys
230+
syscall
231+
syscalls
232+
TCP
233+
tcp
234+
TestU01
235+
threadpool
236+
timestamp
237+
timestamps
238+
TLS
239+
TOCTOU
240+
TODO
241+
Tokio
242+
tokio
243+
tokio's
244+
Tokio's
245+
Tuple
246+
tuple
247+
tx
248+
UDP
249+
udp
250+
UID
251+
unhandled
252+
unix
253+
unlink
254+
unpark
255+
Unpark
256+
unparked
257+
unparking
258+
Unparks
259+
unparks
260+
unreceived
261+
unsafety
262+
Unsets
263+
unsynchronized
264+
untrusted
265+
usecases
266+
Valgrind
267+
Varghese
268+
vec
269+
versa
270+
versioned
271+
versioning
272+
vtable
273+
waker
274+
wakers
275+
Wakers
276+
wakeup
277+
wakeups
278+
workstealing
279+

spellcheck.toml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
dev_comments = false
2+
skip_readme = false
3+
4+
[Hunspell]
5+
lang = "en_US"
6+
search_dirs = ["."]
7+
extra_dictionaries = ["spellcheck.dic"]
8+
skip_os_lookups = true
9+
use_builtin = true
10+
11+
[Hunspell.quirks]
12+
allow_concatenation = true
13+

tokio-stream/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
//!
5555
//! [async-stream]: https://docs.rs/async-stream
5656
//!
57-
//! # Conversion to and from AsyncRead/AsyncWrite
57+
//! # Conversion to and from `AsyncRead`/`AsyncWrite`
5858
//!
5959
//! It is often desirable to convert a `Stream` into an [`AsyncRead`],
6060
//! especially when dealing with plaintext formats streamed over the network.

tokio-stream/src/stream_map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -658,9 +658,9 @@ mod rand {
658658

659659
/// Fast random number generate
660660
///
661-
/// Implement xorshift64+: 2 32-bit xorshift sequences added together.
661+
/// Implement `xorshift64+`: 2 32-bit `xorshift` sequences added together.
662662
/// Shift triplet `[17,7,16]` was calculated as indicated in Marsaglia's
663-
/// Xorshift paper: <https://www.jstatsoft.org/article/view/v008i14/xorshift.pdf>
663+
/// `Xorshift` paper: <https://www.jstatsoft.org/article/view/v008i14/xorshift.pdf>
664664
/// This generator passes the SmallCrush suite, part of TestU01 framework:
665665
/// <http://simul.iro.umontreal.ca/testu01/tu01.html>
666666
#[derive(Debug)]

tokio-stream/src/wrappers/watch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use tokio::sync::watch::error::RecvError;
1010

1111
/// A wrapper around [`tokio::sync::watch::Receiver`] that implements [`Stream`].
1212
///
13-
/// This stream will start by yielding the current value when the WatchStream is polled,
13+
/// This stream will start by yielding the current value when the `WatchStream` is polled,
1414
/// regardless of whether it was the initial value or sent afterwards,
1515
/// unless you use [`WatchStream<T>::from_changes`].
1616
///

tokio-util/src/codec/framed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl<T, U> Framed<T, U> {
130130
/// things like gzip or TLS, which require both read and write access to the
131131
/// underlying object.
132132
///
133-
/// This objects takes a stream and a readbuffer and a writebuffer. These field
133+
/// This objects takes a stream and a `readbuffer` and a `writebuffer`. These field
134134
/// can be obtained from an existing `Framed` with the [`into_parts`] method.
135135
///
136136
/// If you want to work more directly with the streams and sink, consider

0 commit comments

Comments
 (0)