Skip to content

Commit 5fadbea

Browse files
authored
Add typos workflow (#1153)
* Add typos workflow * Fix remaining typos manually
1 parent 4447e9a commit 5fadbea

File tree

15 files changed

+56
-25
lines changed

15 files changed

+56
-25
lines changed

.github/workflows/typos.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- "master"
7+
jobs:
8+
typos:
9+
name: Spell Check with Typos
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Actions Repository
13+
uses: actions/checkout@v3
14+
- name: Check spelling
15+
uses: crate-ci/typos@master

.typos.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[files]
2+
extend-exclude = ["auto", "sys", "gobject-sys", "*.svg"]
3+
4+
[default.extend-words]
5+
# Ignore false-positives
6+
gir = "gir"
7+
mak = "mak"
8+
anid = "anid"
9+
lamda = "lamda"
10+
inout = "inout"
11+
relm = "relm"
12+
ba = "ba"
13+
ue = "ue"
14+
ot = "ot"
15+
siz = "siz"
16+
vai = "vai"

examples/gio_task/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn main() {
3131
main_loop.run();
3232
}
3333

34-
// This function mimicks what the C code using the exported async/finish API would do. It first defines a
34+
// This function mimics what the C code using the exported async/finish API would do. It first defines a
3535
// callback of type GAsyncResult that internally calls get_file_size_finish to retrieve the Task
3636
// result, and simply prints it out. Then it invokes the my_file_size_get_file_size_async method, passing the
3737
// callback to it as parameter.

gio/Gir.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ manual_traits = ["CancellableExtManual"]
398398
ignore = true
399399
[[object.function]]
400400
name = "source_new"
401-
# Only for use with other souce implementations
401+
# Only for use with other source implementations
402402
ignore = true
403403
[[object.signal]]
404404
name = "cancelled"
@@ -491,7 +491,7 @@ generate_builder = true
491491

492492
[[object.function]]
493493
name = "read_line_utf8"
494-
#redudant length returned
494+
#redundant length returned
495495
manual = true
496496

497497
[[object.function]]
@@ -1022,11 +1022,11 @@ name = "Gio.MenuAttributeIter"
10221022
status = "generate"
10231023
[[object.function]]
10241024
name = "get_name"
1025-
# Users shoud use `next` (automatically renamed from `get_next`).
1025+
# Users should use `next` (automatically renamed from `get_next`).
10261026
ignore= true
10271027
[[object.function]]
10281028
name = "get_value"
1029-
# Users shoud use `next` (automatically renamed from `get_next`).
1029+
# Users should use `next` (automatically renamed from `get_next`).
10301030
ignore= true
10311031
[[object.function]]
10321032
name = "next"
@@ -1040,11 +1040,11 @@ name = "Gio.MenuLinkIter"
10401040
status = "generate"
10411041
[[object.function]]
10421042
name = "get_name"
1043-
# Users shoud use `next` (automatically renamed from `get_next`).
1043+
# Users should use `next` (automatically renamed from `get_next`).
10441044
ignore= true
10451045
[[object.function]]
10461046
name = "get_value"
1047-
# Users shoud use `next` (automatically renamed from `get_next`).
1047+
# Users should use `next` (automatically renamed from `get_next`).
10481048
ignore= true
10491049
[[object.function]]
10501050
name = "next"

glib-macros/src/downgrade_derive/fields.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ pub struct DowngradeStructParts {
6666
/// let Named { ref x, ref y } = <expression>;
6767
///
6868
/// match <expression> {
69-
/// Choise::This (ref _0, ref _1) => ... ,
70-
/// Choise::That { ref x, ref y } => ... ,
69+
/// Choice::This (ref _0, ref _1) => ... ,
70+
/// Choice::That { ref x, ref y } => ... ,
7171
/// }
7272
/// ```
7373
///

glib-macros/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ pub fn error_domain_derive(input: TokenStream) -> TokenStream {
545545

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

575575
/// Derive macro for defining a [`SharedType`]`::get_type` function and
576576
/// the [`glib::Value`] traits. Optionally, the type can be marked as
577-
/// `nullable` to get an implemention of `glib::value::ToValueOptional`.
577+
/// `nullable` to get an implementation of `glib::value::ToValueOptional`.
578578
///
579579
/// # Example
580580
///

glib-macros/src/properties.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl PropDesc {
288288
});
289289
let ty = ty.unwrap_or_else(|| field_ty.clone());
290290

291-
// Now that everything is set and safe, return the final proprety description
291+
// Now that everything is set and safe, return the final property description
292292
Ok(Self {
293293
attrs_span,
294294
field_ident,

glib/Gir.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ status = "generate"
8989
ignore = true # needs manual wrappers to make their usage nicer
9090
[[object.function]]
9191
pattern = "compute_.*_for_string"
92-
ignore = true # needs manual wrapper to avoid an unecessary copy of the string
92+
ignore = true # needs manual wrapper to avoid an unnecessary copy of the string
9393
[[object.function]]
9494
pattern = "(idle_remove_by_data|qsort_with_data)"
9595
ignore = true # Unsafe functions

glib/src/gobject/binding_group.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl<'a> BindingGroupBuilder<'a> {
188188
let _ = Box::from_raw(data as *mut (TransformFn, TransformFn, String, ParamSpec));
189189
}
190190

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

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

209209
source_property_name_ptr
210210
};

glib/src/log.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ impl<'a> LogField<'a> {
378378
// rustdoc-stripper-ignore-next
379379
/// Creates a field with an empty value and `data` as a user data key. Fields created with this
380380
/// function are ignored by the default log writer. These fields are used to pass custom data
381-
/// into a writer function set with [`log_set_writer_func`], where it can be retreived using
381+
/// into a writer function set with [`log_set_writer_func`], where it can be retrieved using
382382
/// [`Self::user_data`].
383383
///
384384
/// The passed `usize` can be used by the log writer as a key into a static data structure.
@@ -395,7 +395,7 @@ impl<'a> LogField<'a> {
395395
)
396396
}
397397
// rustdoc-stripper-ignore-next
398-
/// Retreives the field key.
398+
/// Retrieves the field key.
399399
pub fn key(&self) -> &str {
400400
unsafe { std::ffi::CStr::from_ptr(self.0.key as *const _) }
401401
.to_str()

0 commit comments

Comments
 (0)