Skip to content
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

Add typos to CI #441

Merged
merged 4 commits into from
Sep 16, 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
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ env:
DOC_PATH: target/doc

jobs:
typos:
name: Typos
runs-on: ubuntu-latest
steps:
- name: Install typos
run: cargo install typos-cli
- name: Run typos
run: typos .
tests:
name: "LLVM ${{ matrix.llvm-version[0] }}: ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
needs: typos
strategy:
matrix:
llvm-version:
Expand Down
9 changes: 9 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[default]
Copy link
Owner

Choose a reason for hiding this comment

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

What's with the underscore prefix? Shouldn't it be .typos.toml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is so that the typos utility treats it as a configuration file.

extend-ignore-identifiers-re = [
"OLT",
"toi",
"isplay",
"BVE",
"olt",
"TRE",
]
6 changes: 2 additions & 4 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ enum PositionState {
pub enum BuilderError {
#[error("Builder position is not set")]
UnsetPosition,
#[error("GEP error: does not point to a struct or index is out of bounds")]
GEPError,
#[error("Alignment error")]
AlignmentError(&'static str),
#[error("Aggregate extract index out of range")]
Expand Down Expand Up @@ -1104,13 +1102,13 @@ impl<'ctx> Builder<'ctx> {
let pointee_ty = ptr_ty.get_element_type();

if !pointee_ty.is_struct_type() {
return Err(BuilderError::GEPError);
return Err(BuilderError::GEPPointee);
}

let struct_ty = pointee_ty.into_struct_type();

if index >= struct_ty.count_fields() {
return Err(BuilderError::GEPError);
return Err(BuilderError::GEPIndex);
}

let c_string = to_c_str(name);
Expand Down