Add typo detection to CI (#4107)
Adding the typos crate to our CI will take some doing, as we have several tests which rely on typos in various ways (e.g. checking state as the user types), but I thought I'd take a first stab at fixing what it finds. Release Notes: - N/A
This commit is contained in:
commit
aa7351041d
64 changed files with 146 additions and 114 deletions
|
@ -967,8 +967,8 @@ impl AppContext {
|
|||
}
|
||||
|
||||
/// Register a callback to be invoked when a keystroke is received by the application
|
||||
/// in any window. Note that this fires after all other action and event mechansims have resolved
|
||||
/// and that this API will not be invoked if the event's propogation is stopped.
|
||||
/// in any window. Note that this fires after all other action and event mechanisms have resolved
|
||||
/// and that this API will not be invoked if the event's propagation is stopped.
|
||||
pub fn observe_keystrokes(
|
||||
&mut self,
|
||||
f: impl FnMut(&KeystrokeEvent, &mut WindowContext) + 'static,
|
||||
|
|
|
@ -615,7 +615,7 @@ mod test {
|
|||
// Reset
|
||||
state.reset(5);
|
||||
|
||||
// And then recieve a scroll event _before_ the next paint
|
||||
// And then receive a scroll event _before_ the next paint
|
||||
cx.simulate_event(ScrollWheelEvent {
|
||||
position: point(px(1.), px(1.)),
|
||||
delta: ScrollDelta::Pixels(point(px(0.), px(-500.))),
|
||||
|
|
|
@ -150,7 +150,7 @@ impl BackgroundExecutor {
|
|||
Task::Spawned(task)
|
||||
}
|
||||
|
||||
/// Used by the test harness to run an async test in a syncronous fashion.
|
||||
/// Used by the test harness to run an async test in a synchronous fashion.
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
#[track_caller]
|
||||
pub fn block_test<R>(&self, future: impl Future<Output = R>) -> R {
|
||||
|
@ -277,7 +277,7 @@ impl BackgroundExecutor {
|
|||
|
||||
/// Returns a task that will complete after the given duration.
|
||||
/// Depending on other concurrent tasks the elapsed duration may be longer
|
||||
/// than reqested.
|
||||
/// than requested.
|
||||
pub fn timer(&self, duration: Duration) -> Task<()> {
|
||||
let (runnable, task) = async_task::spawn(async move {}, {
|
||||
let dispatcher = self.dispatcher.clone();
|
||||
|
|
|
@ -444,7 +444,7 @@ mod tests {
|
|||
KeyMatch::Some(vec![Box::new(Dollar)])
|
||||
);
|
||||
|
||||
// handle Brazillian quote (quote key then space key)
|
||||
// handle Brazilian quote (quote key then space key)
|
||||
assert_eq!(
|
||||
matcher.match_keystroke(
|
||||
&Keystroke::parse("space->\"").unwrap(),
|
||||
|
@ -453,7 +453,7 @@ mod tests {
|
|||
KeyMatch::Some(vec![Box::new(Quote)])
|
||||
);
|
||||
|
||||
// handle ctrl+` on a brazillian keyboard
|
||||
// handle ctrl+` on a brazilian keyboard
|
||||
assert_eq!(
|
||||
matcher.match_keystroke(&Keystroke::parse("ctrl-->`").unwrap(), &[context_a.clone()]),
|
||||
KeyMatch::Some(vec![Box::new(Backtick)])
|
||||
|
|
|
@ -19,7 +19,7 @@ impl Keystroke {
|
|||
// the ime_key or the key. On some non-US keyboards keys we use in our
|
||||
// bindings are behind option (for example `$` is typed `alt-ç` on a Czech keyboard),
|
||||
// and on some keyboards the IME handler converts a sequence of keys into a
|
||||
// specific character (for example `"` is typed as `" space` on a brazillian keyboard).
|
||||
// specific character (for example `"` is typed as `" space` on a brazilian keyboard).
|
||||
pub fn match_candidates(&self) -> SmallVec<[Keystroke; 2]> {
|
||||
let mut possibilities = SmallVec::new();
|
||||
match self.ime_key.as_ref() {
|
||||
|
|
|
@ -10,7 +10,7 @@ mod open_type;
|
|||
mod platform;
|
||||
mod text_system;
|
||||
mod window;
|
||||
mod window_appearence;
|
||||
mod window_appearance;
|
||||
|
||||
use crate::{px, size, GlobalPixels, Pixels, Size};
|
||||
use cocoa::{
|
||||
|
|
|
@ -42,7 +42,7 @@ pub struct Style {
|
|||
#[refineable]
|
||||
pub inset: Edges<Length>,
|
||||
|
||||
// Size properies
|
||||
// Size properties
|
||||
/// Sets the initial size of the item
|
||||
#[refineable]
|
||||
pub size: Size<Length>,
|
||||
|
@ -79,7 +79,7 @@ pub struct Style {
|
|||
#[refineable]
|
||||
pub gap: Size<DefiniteLength>,
|
||||
|
||||
// Flexbox properies
|
||||
// Flexbox properties
|
||||
/// Which direction does the main axis flow in?
|
||||
pub flex_direction: FlexDirection,
|
||||
/// Should elements wrap, or stay in a single line?
|
||||
|
@ -502,7 +502,7 @@ impl Default for Style {
|
|||
max_size: Size::auto(),
|
||||
aspect_ratio: None,
|
||||
gap: Size::default(),
|
||||
// Aligment
|
||||
// Alignment
|
||||
align_items: None,
|
||||
align_self: None,
|
||||
align_content: None,
|
||||
|
|
|
@ -200,7 +200,7 @@ impl<V> PartialEq for WeakView<V> {
|
|||
|
||||
impl<V> Eq for WeakView<V> {}
|
||||
|
||||
/// A dynically-typed handle to a view, which can be downcast to a [View] for a specific type.
|
||||
/// A dynamically-typed handle to a view, which can be downcast to a [View] for a specific type.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct AnyView {
|
||||
model: AnyModel,
|
||||
|
|
|
@ -2131,7 +2131,7 @@ impl<'a> WindowContext<'a> {
|
|||
.unwrap();
|
||||
|
||||
// Actual: Option<AnyElement> <- View
|
||||
// Requested: () <- AnyElemet
|
||||
// Requested: () <- AnyElement
|
||||
let state = state_box
|
||||
.take()
|
||||
.expect("element state is already on the stack");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue