Skip to content

Commit c5e8b95

Browse files
committed
ci: add spellcheck with "typos"
This adds the "typos" utility as additional CI step. Additionally, all existing typos are fixed.
1 parent 39fee66 commit c5e8b95

File tree

16 files changed

+43
-18
lines changed

16 files changed

+43
-18
lines changed

.github/workflows/qa.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: QA
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
spellcheck:
7+
name: Spellcheck
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- uses: actions/checkout@v3
11+
# Executes "typos ."
12+
- uses: crate-ci/typos@v1.13.20

.typos.toml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Configuration for the typos spell checker utility (<https://github.com/crate-ci/typos>).
2+
3+
[files]
4+
extend-exclude = [
5+
# "uefi/src/table/boot.rs"
6+
]
7+
8+
[default.extend-words]
9+
# FOOBAR = "FOOBAR"
10+
11+
[default.extend-identifiers]
12+
# FOOBAR = "FOOBAR"
13+

PUBLISHING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ which crates were modified and how should their version numbers be incremented.
1515

1616
Incrementing the version number of a crate is as simple as editing
1717
the corresponding `Cargo.toml` file and updating the `version = ...` line,
18-
then commiting the change (preferrably on a new branch, so that all of the version bumps
18+
then committing the change (preferably on a new branch, so that all the version bumps
1919
can be combined in a single pull request).
2020

2121
### Crate dependencies

book/src/concepts/gpt.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ systems too. There are a couple big advantages of using GPT over MBR:
1010

1111
A GPT disk contains a primary header near the beginning of the disk,
1212
followed by a partition entry array. The header and partition entry
13-
array have a secondary copy at the end of the disk for redundency. The
13+
array have a secondary copy at the end of the disk for redundancy. The
1414
partition entry arrays contain structures that describe each partition,
1515
including a GUID to identify the individual partition, a partition type
1616
GUID to indicate the purpose of the partition, and start/end block

uefi-test-runner/src/proto/debug.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ fn test_invalidate_instruction_cache(debug_support: &mut DebugSupport) {
9696
debug_support
9797
.invalidate_instruction_cache(0, ptr, 64)
9898
// Should always pass, since the spec says this always returns EFI_SUCCESS
99-
.expect("Error occured while invalidating instruction cache");
99+
.expect("Error occurred while invalidating instruction cache");
100100
}
101101
}
102102

uefi/src/data_types/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ mod tests {
176176
assert_eq!(X::round_up_to_alignment(7), 8);
177177
assert_eq!(X::round_up_to_alignment(8), 8);
178178

179-
// Get an intentionally mis-aligned buffer.
179+
// Get an intentionally misaligned buffer.
180180
let mut buffer = [0u8; 16];
181181
let mut buffer = &mut buffer[..];
182182
if (buffer.as_ptr() as usize) % X::alignment() == 0 {

uefi/src/proto/console/gop.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ impl<'gop> FrameBuffer<'gop> {
631631
/// # Safety
632632
///
633633
/// This operation is unsafe because...
634-
/// - It is your reponsibility to make sure that the value type makes sense
634+
/// - It is your responsibility to make sure that the value type makes sense
635635
/// - You must honor the pixel format and stride specified by the mode info
636636
/// - There is no bound checking on memory accesses in release mode
637637
#[inline]
@@ -653,7 +653,7 @@ impl<'gop> FrameBuffer<'gop> {
653653
/// # Safety
654654
///
655655
/// This operation is unsafe because...
656-
/// - It is your reponsibility to make sure that the value type makes sense
656+
/// - It is your responsibility to make sure that the value type makes sense
657657
/// - You must honor the pixel format and stride specified by the mode info
658658
/// - There is no bound checking on memory accesses in release mode
659659
#[inline]

uefi/src/proto/console/pointer/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl<'boot> Pointer<'boot> {
2727
(self.reset)(self, extended_verification).into()
2828
}
2929

30-
/// Retrieves the pointer device's current state, if a state change occured
30+
/// Retrieves the pointer device's current state, if a state change occurred
3131
/// since the last time this function was called.
3232
///
3333
/// Use `wait_for_input_event()` with the `BootServices::wait_for_event()`

uefi/src/proto/debug/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// note from the spec:
22
// When the context record field is larger than the register being stored in it, the upper bits of the
33
// context record field are unused and ignored
4-
/// Universal EFI_SYSTEM_CONTEXT defintion
4+
/// Universal EFI_SYSTEM_CONTEXT definition
55
/// This is passed to debug callbacks
66
#[repr(C)]
77
pub union SystemContext {

uefi/src/proto/device_path/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! Device Path protocol
22
//!
33
//! A UEFI device path is a very flexible structure for encoding a
4-
//! programatic path such as a hard drive or console.
4+
//! programmatic path such as a hard drive or console.
55
//!
66
//! A device path is made up of a packed list of variable-length nodes of
77
//! various types. The entire device path is terminated with an

uefi/src/proto/device_path/text.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ pub struct DevicePathToText {
9999
impl DevicePathToText {
100100
/// Convert a device node to its text representation.
101101
///
102-
/// Returns an [`OUT_OF_RESOURCES`] error if there is unsufficient
102+
/// Returns an [`OUT_OF_RESOURCES`] error if there is insufficient
103103
/// memory for the conversion.
104104
///
105105
/// [`OUT_OF_RESOURCES`]: Status::OUT_OF_RESOURCES
@@ -122,7 +122,7 @@ impl DevicePathToText {
122122

123123
/// Convert a device path to its text representation.
124124
///
125-
/// Returns an [`OUT_OF_RESOURCES`] error if there is unsufficient
125+
/// Returns an [`OUT_OF_RESOURCES`] error if there is insufficient
126126
/// memory for the conversion.
127127
///
128128
/// [`OUT_OF_RESOURCES`]: Status::OUT_OF_RESOURCES
@@ -164,7 +164,7 @@ impl DevicePathFromText {
164164
/// Conversion starts with the first character and continues until
165165
/// the first non-device node character.
166166
///
167-
/// Returns an [`OUT_OF_RESOURCES`] error if there is unsufficient
167+
/// Returns an [`OUT_OF_RESOURCES`] error if there is insufficient
168168
/// memory for the conversion.
169169
///
170170
/// [`OUT_OF_RESOURCES`]: Status::OUT_OF_RESOURCES
@@ -188,7 +188,7 @@ impl DevicePathFromText {
188188
/// Conversion starts with the first character and continues until
189189
/// the first non-device path character.
190190
///
191-
/// Returns an [`OUT_OF_RESOURCES`] error if there is unsufficient
191+
/// Returns an [`OUT_OF_RESOURCES`] error if there is insufficient
192192
/// memory for the conversion.
193193
///
194194
/// [`OUT_OF_RESOURCES`]: Status::OUT_OF_RESOURCES

uefi/src/proto/media/disk.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use core::ptr::NonNull;
88
///
99
/// This protocol is used to abstract the block accesses of the block I/O
1010
/// protocol to a more general offset-length protocol. Firmware is
11-
/// reponsible for adding this protocol to any block I/O interface that
11+
/// responsible for adding this protocol to any block I/O interface that
1212
/// appears in the system that does not already have a disk I/O protocol.
1313
#[repr(C)]
1414
#[unsafe_protocol("ce345171-ba0b-11d2-8e4f-00a0c969723b")]

uefi/src/proto/media/file/regular.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl RegularFile {
6363
/// Write `buffer` to file, increment the file pointer.
6464
///
6565
/// If an error occurs, returns the number of bytes that were actually written. If no error
66-
/// occured, the entire buffer is guaranteed to have been written successfully.
66+
/// occurred, the entire buffer is guaranteed to have been written successfully.
6767
///
6868
/// # Arguments
6969
/// * `buffer` Buffer to write to file

uefi/src/proto/network/snp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ bitflags! {
287287

288288
bitflags! {
289289
/// Flags returned by get_interrupt_status to indicate which interrupts have fired on the
290-
/// interace since the last call.
290+
/// interface since the last call.
291291
pub struct InterruptStatus : u32 {
292292
/// Packet received.
293293
const RECEIVE = 0x01;

uefi/src/proto/string/unicode_collation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use uefi::data_types::{CStr16, CStr8, Char16, Char8};
99

1010
/// The Unicode Collation Protocol.
1111
///
12-
/// Used to perform case-insensitive comaprisons of strings.
12+
/// Used to perform case-insensitive comparisons of strings.
1313
#[repr(C)]
1414
#[unsafe_protocol("a4c751fc-23ae-4c3e-92e9-4964cf63f349")]
1515
pub struct UnicodeCollation {

xtask/src/device_path/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ struct, is motivated primarily by DST nodes. Many nodes end in a
7070
dynamically-sized slice, which prevents the normal struct construction
7171
syntax from being used. One option would be to generate a construction
7272
function that takes an argument for each field, but that can negatively
73-
impact readibility since there's no named-argument syntax. Having a
73+
impact readability since there's no named-argument syntax. Having a
7474
separate builder struct allows us to use the normal struct construction
7575
syntax. DST fields in the builder are replaced with slice references.
7676

0 commit comments

Comments
 (0)