Skip to content

ci: add spellcheck with "typos" #687

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

Merged
merged 1 commit into from
Mar 9, 2023
Merged
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
12 changes: 12 additions & 0 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: QA

on: [ push, pull_request ]

jobs:
spellcheck:
name: Spellcheck
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# Executes "typos ."
- uses: crate-ci/[email protected]
13 changes: 13 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Configuration for the typos spell checker utility (<https://github.com/crate-ci/typos>).

[files]
extend-exclude = [
# "uefi/src/table/boot.rs"
]

[default.extend-words]
# FOOBAR = "FOOBAR"

[default.extend-identifiers]
# FOOBAR = "FOOBAR"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these default values? If so, can we drop the config file entirely?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might happen that we have to add something there eventually. This is also necessary in a few other projects of mine. I thought, it might be easier for us if we already have the file as template in the repo. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would slightly prefer that we drop the config file until such time as we need it, just to avoid having unnecessary stuff in the root of the repo. It's not something I feel super strongly about though.

2 changes: 1 addition & 1 deletion PUBLISHING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ which crates were modified and how should their version numbers be incremented.

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

### Crate dependencies
Expand Down
2 changes: 1 addition & 1 deletion book/src/concepts/gpt.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ systems too. There are a couple big advantages of using GPT over MBR:

A GPT disk contains a primary header near the beginning of the disk,
followed by a partition entry array. The header and partition entry
array have a secondary copy at the end of the disk for redundency. The
array have a secondary copy at the end of the disk for redundancy. The
partition entry arrays contain structures that describe each partition,
including a GUID to identify the individual partition, a partition type
GUID to indicate the purpose of the partition, and start/end block
Expand Down
2 changes: 1 addition & 1 deletion uefi-test-runner/src/proto/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fn test_invalidate_instruction_cache(debug_support: &mut DebugSupport) {
debug_support
.invalidate_instruction_cache(0, ptr, 64)
// Should always pass, since the spec says this always returns EFI_SUCCESS
.expect("Error occured while invalidating instruction cache");
.expect("Error occurred while invalidating instruction cache");
}
}

Expand Down
2 changes: 1 addition & 1 deletion uefi/src/data_types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ mod tests {
assert_eq!(X::round_up_to_alignment(7), 8);
assert_eq!(X::round_up_to_alignment(8), 8);

// Get an intentionally mis-aligned buffer.
// Get an intentionally misaligned buffer.
let mut buffer = [0u8; 16];
let mut buffer = &mut buffer[..];
if (buffer.as_ptr() as usize) % X::alignment() == 0 {
Expand Down
4 changes: 2 additions & 2 deletions uefi/src/proto/console/gop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ impl<'gop> FrameBuffer<'gop> {
/// # Safety
///
/// This operation is unsafe because...
/// - It is your reponsibility to make sure that the value type makes sense
/// - It is your responsibility to make sure that the value type makes sense
/// - You must honor the pixel format and stride specified by the mode info
/// - There is no bound checking on memory accesses in release mode
#[inline]
Expand All @@ -653,7 +653,7 @@ impl<'gop> FrameBuffer<'gop> {
/// # Safety
///
/// This operation is unsafe because...
/// - It is your reponsibility to make sure that the value type makes sense
/// - It is your responsibility to make sure that the value type makes sense
/// - You must honor the pixel format and stride specified by the mode info
/// - There is no bound checking on memory accesses in release mode
#[inline]
Expand Down
2 changes: 1 addition & 1 deletion uefi/src/proto/console/pointer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl<'boot> Pointer<'boot> {
(self.reset)(self, extended_verification).into()
}

/// Retrieves the pointer device's current state, if a state change occured
/// Retrieves the pointer device's current state, if a state change occurred
/// since the last time this function was called.
///
/// Use `wait_for_input_event()` with the `BootServices::wait_for_event()`
Expand Down
2 changes: 1 addition & 1 deletion uefi/src/proto/debug/context.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// note from the spec:
// When the context record field is larger than the register being stored in it, the upper bits of the
// context record field are unused and ignored
/// Universal EFI_SYSTEM_CONTEXT defintion
/// Universal EFI_SYSTEM_CONTEXT definition
/// This is passed to debug callbacks
#[repr(C)]
pub union SystemContext {
Expand Down
2 changes: 1 addition & 1 deletion uefi/src/proto/device_path/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Device Path protocol
//!
//! A UEFI device path is a very flexible structure for encoding a
//! programatic path such as a hard drive or console.
//! programmatic path such as a hard drive or console.
//!
//! A device path is made up of a packed list of variable-length nodes of
//! various types. The entire device path is terminated with an
Expand Down
8 changes: 4 additions & 4 deletions uefi/src/proto/device_path/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub struct DevicePathToText {
impl DevicePathToText {
/// Convert a device node to its text representation.
///
/// Returns an [`OUT_OF_RESOURCES`] error if there is unsufficient
/// Returns an [`OUT_OF_RESOURCES`] error if there is insufficient
/// memory for the conversion.
///
/// [`OUT_OF_RESOURCES`]: Status::OUT_OF_RESOURCES
Expand All @@ -122,7 +122,7 @@ impl DevicePathToText {

/// Convert a device path to its text representation.
///
/// Returns an [`OUT_OF_RESOURCES`] error if there is unsufficient
/// Returns an [`OUT_OF_RESOURCES`] error if there is insufficient
/// memory for the conversion.
///
/// [`OUT_OF_RESOURCES`]: Status::OUT_OF_RESOURCES
Expand Down Expand Up @@ -164,7 +164,7 @@ impl DevicePathFromText {
/// Conversion starts with the first character and continues until
/// the first non-device node character.
///
/// Returns an [`OUT_OF_RESOURCES`] error if there is unsufficient
/// Returns an [`OUT_OF_RESOURCES`] error if there is insufficient
/// memory for the conversion.
///
/// [`OUT_OF_RESOURCES`]: Status::OUT_OF_RESOURCES
Expand All @@ -188,7 +188,7 @@ impl DevicePathFromText {
/// Conversion starts with the first character and continues until
/// the first non-device path character.
///
/// Returns an [`OUT_OF_RESOURCES`] error if there is unsufficient
/// Returns an [`OUT_OF_RESOURCES`] error if there is insufficient
/// memory for the conversion.
///
/// [`OUT_OF_RESOURCES`]: Status::OUT_OF_RESOURCES
Expand Down
2 changes: 1 addition & 1 deletion uefi/src/proto/media/disk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use core::ptr::NonNull;
///
/// This protocol is used to abstract the block accesses of the block I/O
/// protocol to a more general offset-length protocol. Firmware is
/// reponsible for adding this protocol to any block I/O interface that
/// responsible for adding this protocol to any block I/O interface that
/// appears in the system that does not already have a disk I/O protocol.
#[repr(C)]
#[unsafe_protocol("ce345171-ba0b-11d2-8e4f-00a0c969723b")]
Expand Down
2 changes: 1 addition & 1 deletion uefi/src/proto/media/file/regular.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl RegularFile {
/// Write `buffer` to file, increment the file pointer.
///
/// If an error occurs, returns the number of bytes that were actually written. If no error
/// occured, the entire buffer is guaranteed to have been written successfully.
/// occurred, the entire buffer is guaranteed to have been written successfully.
///
/// # Arguments
/// * `buffer` Buffer to write to file
Expand Down
2 changes: 1 addition & 1 deletion uefi/src/proto/network/snp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ bitflags! {

bitflags! {
/// Flags returned by get_interrupt_status to indicate which interrupts have fired on the
/// interace since the last call.
/// interface since the last call.
pub struct InterruptStatus : u32 {
/// Packet received.
const RECEIVE = 0x01;
Expand Down
2 changes: 1 addition & 1 deletion uefi/src/proto/string/unicode_collation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use uefi::data_types::{CStr16, CStr8, Char16, Char8};

/// The Unicode Collation Protocol.
///
/// Used to perform case-insensitive comaprisons of strings.
/// Used to perform case-insensitive comparisons of strings.
#[repr(C)]
#[unsafe_protocol("a4c751fc-23ae-4c3e-92e9-4964cf63f349")]
pub struct UnicodeCollation {
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/device_path/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ struct, is motivated primarily by DST nodes. Many nodes end in a
dynamically-sized slice, which prevents the normal struct construction
syntax from being used. One option would be to generate a construction
function that takes an argument for each field, but that can negatively
impact readibility since there's no named-argument syntax. Having a
impact readability since there's no named-argument syntax. Having a
separate builder struct allows us to use the normal struct construction
syntax. DST fields in the builder are replaced with slice references.

Expand Down