Skip to content

Commit c032ea0

Browse files
authored
ci: detect trailing whitespace (#7013)
1 parent 0b31c2f commit c032ea0

File tree

9 files changed

+29
-28
lines changed

9 files changed

+29
-28
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 2.1
1+
version: 2.1
22
jobs:
33
test-arm:
44
machine:

.github/buildomat/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ reproduce the failure on other operating systems, don't worry! The
1212
[tokio-rs/illumos] team is responsible for maintaining Tokio's illumos support,
1313
and can be called on to assist contributors with illumos-specific issues. Please
1414
feel free to tag @tokio-rs/illumos to ask for help resolving build failures on
15-
illumos
15+
illumos.
1616

1717
[illumos]: https://www.illumos.org/
1818
[Buildomat]: https://github.com/oxidecomputer/buildomat

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1103,4 +1103,5 @@ jobs:
11031103
}
11041104
- name: Run cargo-spellcheck
11051105
run: cargo spellcheck --code 1
1106-
1106+
- name: Detect trailing whitespace
1107+
run: if grep --exclude-dir=.git --exclude-dir=target -re '\s$' . ; then exit 1; fi

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ LOOM_MAX_PREEMPTIONS=1 LOOM_MAX_BRANCHES=10000 RUSTFLAGS="--cfg loom -C debug_as
196196
cargo test --lib --release --features full -- --test-threads=1 --nocapture
197197
```
198198
Additionally, you can also add `--cfg tokio_unstable` to the `RUSTFLAGS` environment variable to
199-
run loom tests that test unstable features.
199+
run loom tests that test unstable features.
200200

201201
You can run miri tests with
202202
```
@@ -216,8 +216,8 @@ cargo install --locked cargo-spellcheck
216216
cargo spellcheck check
217217
```
218218

219-
if the command rejects a word, you should backtick the rejected word if it's code related. If not, the
220-
rejected word should be put into `spellcheck.dic` file.
219+
if the command rejects a word, you should backtick the rejected word if it's code related. If not, the
220+
rejected word should be put into `spellcheck.dic` file.
221221

222222
Note that when you add a word into the file, you should also update the first line which tells the spellcheck tool
223223
the total number of words included in the file

tokio-util/src/task/spawn_pinned.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ use tokio::task::{spawn_local, JoinHandle, LocalSet};
3939
/// task::spawn_local(async move {
4040
/// println!("{}", data_clone);
4141
/// });
42-
///
42+
///
4343
/// data.to_string()
44-
/// }
44+
/// }
4545
/// }).await.unwrap();
4646
/// println!("output: {}", output);
4747
/// }

tokio/src/net/unix/stream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl UnixStream {
142142
/// // if the readiness event is a false positive.
143143
/// match stream.try_read(&mut data) {
144144
/// Ok(n) => {
145-
/// println!("read {} bytes", n);
145+
/// println!("read {} bytes", n);
146146
/// }
147147
/// Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {
148148
/// continue;

tokio/src/runtime/builder.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,11 @@ impl Builder {
706706
///
707707
/// This *does not* support [`LocalSet`](crate::task::LocalSet) at this time.
708708
///
709-
/// **Note**: This is an [unstable API][unstable]. The public API of this type
710-
/// may break in 1.x releases. See [the documentation on unstable
711-
/// features][unstable] for details.
712-
///
713-
/// [unstable]: crate#unstable-features
709+
/// **Note**: This is an [unstable API][unstable]. The public API of this type
710+
/// may break in 1.x releases. See [the documentation on unstable
711+
/// features][unstable] for details.
712+
///
713+
/// [unstable]: crate#unstable-features
714714
///
715715
/// # Examples
716716
///
@@ -755,11 +755,11 @@ impl Builder {
755755
///
756756
/// This *does not* support [`LocalSet`](crate::task::LocalSet) at this time.
757757
///
758-
/// **Note**: This is an [unstable API][unstable]. The public API of this type
759-
/// may break in 1.x releases. See [the documentation on unstable
760-
/// features][unstable] for details.
761-
///
762-
/// [unstable]: crate#unstable-features
758+
/// **Note**: This is an [unstable API][unstable]. The public API of this type
759+
/// may break in 1.x releases. See [the documentation on unstable
760+
/// features][unstable] for details.
761+
///
762+
/// [unstable]: crate#unstable-features
763763
///
764764
/// # Examples
765765
///

tokio/src/runtime/task_hooks.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ pub(crate) struct TaskHooks {
1616

1717
/// Task metadata supplied to user-provided hooks for task events.
1818
///
19-
/// **Note**: This is an [unstable API][unstable]. The public API of this type
20-
/// may break in 1.x releases. See [the documentation on unstable
21-
/// features][unstable] for details.
22-
///
23-
/// [unstable]: crate#unstable-features
19+
/// **Note**: This is an [unstable API][unstable]. The public API of this type
20+
/// may break in 1.x releases. See [the documentation on unstable
21+
/// features][unstable] for details.
22+
///
23+
/// [unstable]: crate#unstable-features
2424
#[allow(missing_debug_implementations)]
2525
#[cfg_attr(not(tokio_unstable), allow(unreachable_pub))]
2626
pub struct TaskMeta<'a> {

tokio/src/task/join_set.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,9 @@ impl<T: 'static> JoinSet<T> {
395395
/// tokio::time::sleep(Duration::from_secs(3 - i)).await;
396396
/// i
397397
/// });
398-
/// }
398+
/// }
399399
///
400-
/// let output = set.join_all().await;
400+
/// let output = set.join_all().await;
401401
/// assert_eq!(output, vec![2, 1, 0]);
402402
/// }
403403
/// ```
@@ -414,8 +414,8 @@ impl<T: 'static> JoinSet<T> {
414414
///
415415
/// for i in 0..3 {
416416
/// set.spawn(async move {i});
417-
/// }
418-
///
417+
/// }
418+
///
419419
/// let mut output = Vec::new();
420420
/// while let Some(res) = set.join_next().await{
421421
/// match res {

0 commit comments

Comments
 (0)