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 workflow #1153

Merged
merged 2 commits into from
Aug 2, 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
15 changes: 15 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: CI
on:
pull_request:
push:
branches:
- "master"
jobs:
typos:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
- name: Check spelling
uses: crate-ci/typos@master
16 changes: 16 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[files]
extend-exclude = ["auto", "sys", "gobject-sys", "*.svg"]

[default.extend-words]
# Ignore false-positives
gir = "gir"
mak = "mak"
anid = "anid"
lamda = "lamda"
inout = "inout"
relm = "relm"
ba = "ba"
ue = "ue"
ot = "ot"
siz = "siz"
vai = "vai"
2 changes: 1 addition & 1 deletion examples/gio_task/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn main() {
main_loop.run();
}

// This function mimicks what the C code using the exported async/finish API would do. It first defines a
// This function mimics what the C code using the exported async/finish API would do. It first defines a
// callback of type GAsyncResult that internally calls get_file_size_finish to retrieve the Task
// result, and simply prints it out. Then it invokes the my_file_size_get_file_size_async method, passing the
// callback to it as parameter.
Expand Down
12 changes: 6 additions & 6 deletions gio/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ manual_traits = ["CancellableExtManual"]
ignore = true
[[object.function]]
name = "source_new"
# Only for use with other souce implementations
# Only for use with other source implementations
ignore = true
[[object.signal]]
name = "cancelled"
Expand Down Expand Up @@ -491,7 +491,7 @@ generate_builder = true

[[object.function]]
name = "read_line_utf8"
#redudant length returned
#redundant length returned
manual = true

[[object.function]]
Expand Down Expand Up @@ -1022,11 +1022,11 @@ name = "Gio.MenuAttributeIter"
status = "generate"
[[object.function]]
name = "get_name"
# Users shoud use `next` (automatically renamed from `get_next`).
# Users should use `next` (automatically renamed from `get_next`).
ignore= true
[[object.function]]
name = "get_value"
# Users shoud use `next` (automatically renamed from `get_next`).
# Users should use `next` (automatically renamed from `get_next`).
ignore= true
[[object.function]]
name = "next"
Expand All @@ -1040,11 +1040,11 @@ name = "Gio.MenuLinkIter"
status = "generate"
[[object.function]]
name = "get_name"
# Users shoud use `next` (automatically renamed from `get_next`).
# Users should use `next` (automatically renamed from `get_next`).
ignore= true
[[object.function]]
name = "get_value"
# Users shoud use `next` (automatically renamed from `get_next`).
# Users should use `next` (automatically renamed from `get_next`).
ignore= true
[[object.function]]
name = "next"
Expand Down
4 changes: 2 additions & 2 deletions glib-macros/src/downgrade_derive/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ pub struct DowngradeStructParts {
/// let Named { ref x, ref y } = <expression>;
///
/// match <expression> {
/// Choise::This (ref _0, ref _1) => ... ,
/// Choise::That { ref x, ref y } => ... ,
/// Choice::This (ref _0, ref _1) => ... ,
/// Choice::That { ref x, ref y } => ... ,
/// }
/// ```
///
Expand Down
4 changes: 2 additions & 2 deletions glib-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ pub fn error_domain_derive(input: TokenStream) -> TokenStream {

/// Derive macro for defining a [`BoxedType`]`::type_` function and
/// the [`glib::Value`] traits. Optionally, the type can be marked as
/// `nullable` to get an implemention of `glib::value::ToValueOptional`.
/// `nullable` to get an implementation of `glib::value::ToValueOptional`.
///
/// # Example
///
Expand Down Expand Up @@ -574,7 +574,7 @@ pub fn boxed_derive(input: TokenStream) -> TokenStream {

/// Derive macro for defining a [`SharedType`]`::get_type` function and
/// the [`glib::Value`] traits. Optionally, the type can be marked as
/// `nullable` to get an implemention of `glib::value::ToValueOptional`.
/// `nullable` to get an implementation of `glib::value::ToValueOptional`.
///
/// # Example
///
Expand Down
2 changes: 1 addition & 1 deletion glib-macros/src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl PropDesc {
});
let ty = ty.unwrap_or_else(|| field_ty.clone());

// Now that everything is set and safe, return the final proprety description
// Now that everything is set and safe, return the final property description
Ok(Self {
attrs_span,
field_ident,
Expand Down
2 changes: 1 addition & 1 deletion glib/Gir.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ status = "generate"
ignore = true # needs manual wrappers to make their usage nicer
[[object.function]]
pattern = "compute_.*_for_string"
ignore = true # needs manual wrapper to avoid an unecessary copy of the string
ignore = true # needs manual wrapper to avoid an unnecessary copy of the string
[[object.function]]
pattern = "(idle_remove_by_data|qsort_with_data)"
ignore = true # Unsafe functions
Expand Down
10 changes: 5 additions & 5 deletions glib/src/gobject/binding_group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl<'a> BindingGroupBuilder<'a> {
let _ = Box::from_raw(data as *mut (TransformFn, TransformFn, String, ParamSpec));
}

let mut _source_propery_name_cstr = None;
let mut _source_property_name_cstr = None;
let source_property_name = if let Some(source) = self.group.source() {
let source_property = source.find_property(self.source_property).ok_or_else(|| {
bool_error!(
Expand All @@ -198,13 +198,13 @@ impl<'a> BindingGroupBuilder<'a> {
)
})?;

// This is NUL-termianted from the C side
// This is NUL-terminated from the C side
source_property.name().as_ptr()
} else {
// This is a Rust &str and needs to be NUL-terminated first
let source_propery_name = std::ffi::CString::new(self.source_property).unwrap();
let source_property_name_ptr = source_propery_name.as_ptr() as *const u8;
_source_propery_name_cstr = Some(source_propery_name);
let source_property_name = std::ffi::CString::new(self.source_property).unwrap();
let source_property_name_ptr = source_property_name.as_ptr() as *const u8;
_source_property_name_cstr = Some(source_property_name);

source_property_name_ptr
};
Expand Down
4 changes: 2 additions & 2 deletions glib/src/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ impl<'a> LogField<'a> {
// rustdoc-stripper-ignore-next
/// Creates a field with an empty value and `data` as a user data key. Fields created with this
/// function are ignored by the default log writer. These fields are used to pass custom data
/// into a writer function set with [`log_set_writer_func`], where it can be retreived using
/// into a writer function set with [`log_set_writer_func`], where it can be retrieved using
/// [`Self::user_data`].
///
/// The passed `usize` can be used by the log writer as a key into a static data structure.
Expand All @@ -395,7 +395,7 @@ impl<'a> LogField<'a> {
)
}
// rustdoc-stripper-ignore-next
/// Retreives the field key.
/// Retrieves the field key.
pub fn key(&self) -> &str {
unsafe { std::ffi::CStr::from_ptr(self.0.key as *const _) }
.to_str()
Expand Down
2 changes: 1 addition & 1 deletion glib/src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl<T: ObjectType> Cast for T {}
/// Convenience trait mirroring `Cast`, implemented on `Option<Object>` types.
///
/// # Warning
/// Inveitably this trait will discard informations about a downcast failure:
/// Inevitably this trait will discard information about a downcast failure:
/// you don't know if the object was not of the expected type, or if it was `None`.
/// If you need to handle the downcast error, use `Cast` over a `glib::Object`.
///
Expand Down
2 changes: 1 addition & 1 deletion glib/src/property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl<T: Property> Property for std::cell::OnceCell<T> {
impl<T: Property> Property for std::sync::OnceLock<T> {
type Value = T::Value;
}
// Handle smart pointers trasparently
// Handle smart pointers transparently
impl<T: Property> Property for Rc<T> {
type Value = T::Value;
}
Expand Down
2 changes: 1 addition & 1 deletion glib/src/subclass/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ mod test {
assert!(name_changed_triggered.load(Ordering::Relaxed));
}

// Note: can't test type mismatch in signals since panics accross FFI boundaries
// Note: can't test type mismatch in signals since panics across FFI boundaries
// are UB. See https://github.com/gtk-rs/glib/issues/518

#[test]
Expand Down
2 changes: 1 addition & 1 deletion glib/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ pub trait ToValue {
fn to_value(&self) -> Value;

// rustdoc-stripper-ignore-next
/// Returns the type identifer of `self`.
/// Returns the type identifier of `self`.
///
/// This is the type of the value to be returned by `to_value`.
fn value_type(&self) -> Type;
Expand Down
2 changes: 1 addition & 1 deletion pango/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl FromGlib<ffi::PangoLayoutDeserializeError> for LayoutDeserializeError {
#[cfg(feature = "v1_50")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_50")))]
impl ErrorDomain for LayoutDeserializeError {
// TODO: figure out why gir picks a non-existant quark function
// TODO: figure out why gir picks a non-existent quark function
#[doc(alias = "pango_layout_deserialize_error_quark")]
fn domain() -> Quark {
unsafe { from_glib(ffi::pango_layout_deserialize_error_quark()) }
Expand Down
Loading