From 1df8ab9dba5e1c9471b6a648e166072c475a9b64 Mon Sep 17 00:00:00 2001 From: Vaishnav Sabari Girish Date: Tue, 10 Mar 2026 11:02:35 +0530 Subject: [PATCH] ci(typo): Trying out typo checker CI Signed-off-by: Vaishnav Sabari Girish --- .github/workflows/typos.yml | 18 ++++++++++++++++++ Cargo.lock | 4 ++-- _typos.toml | 17 +++++++++++++++++ crates/ns_io/src/input.rs | 2 +- crates/ns_io/src/print.rs | 4 ++-- 5 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/typos.yml create mode 100644 _typos.toml diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 0000000..d2eeeaa --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,18 @@ +name: Check for typos + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + typos-check: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v6.0.2 + - name: Run typos checker + uses: crate-ci/typos@master + with: + args: README.md USAGE.md BUILD.md diff --git a/Cargo.lock b/Cargo.lock index 085c460..d2a679e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,11 +4,11 @@ version = 4 [[package]] name = "ns_io" -version = "0.1.0" +version = "0.1.6" dependencies = [ "ns_string", ] [[package]] name = "ns_string" -version = "0.1.0" +version = "0.1.6" diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 0000000..e7963b8 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,17 @@ +[default.extend-words] +nextstd = "nextstd" +stdio = "stdio" +NextStd = "NextStd" +sso = "sso" +SSO = "SSO" +toml = "toml" +ns = "ns" +Iinclude = "Iinclude" + +[default] +extend-ignore-identifiers-re = [ + "^ns_.*$", +] + +[files] +extend-exclude = ["CHANGELOG.md"] diff --git a/crates/ns_io/src/input.rs b/crates/ns_io/src/input.rs index e4e5208..78206bf 100644 --- a/crates/ns_io/src/input.rs +++ b/crates/ns_io/src/input.rs @@ -1,7 +1,7 @@ use std::io::{self}; use std::ffi::{c_int, c_float,c_double}; -// Helper function to read a line from stdin safetly +// Helper function to read a line from stdin safely fn read_line_buffer() -> String { let mut buffer = String::new(); diff --git a/crates/ns_io/src/print.rs b/crates/ns_io/src/print.rs index 32e87fd..7988a57 100644 --- a/crates/ns_io/src/print.rs +++ b/crates/ns_io/src/print.rs @@ -34,7 +34,7 @@ pub extern "C" fn ns_print_double(val: f64) { #[unsafe(no_mangle)] // If the C string is not null terminaltes '\0' , the function will keep on reading memory until // the program crashes (Segfault) -// The below supression is to prevent that +// The below suppression is to prevent that #[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn ns_print_string(ptr: *const c_char) { // Never Dereference a NULL pointer @@ -82,7 +82,7 @@ pub extern "C" fn ns_println_double(val: f64) { #[unsafe(no_mangle)] // If the C string is not null terminaltes '\0' , the function will keep on reading memory until // the program crashes (Segfault) -// The below supression is to prevent that +// The below suppression is to prevent that #[allow(clippy::not_unsafe_ptr_arg_deref)] pub extern "C" fn ns_println_string(ptr: *const c_char) { // Never Dereference a NULL pointer