fix most typos, add crate-ci/typos to CI (#2653)

* fix most typos, add crate-ci/typos to CI

---------

Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
Tristan F.andJonathan Kelley authored and GitHub committed 2024-07-23 17:49:33 -07:00
1 parent 841b447d2a
commit 9167cd9dec
83 files changed
+258 -203

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
//! diagnostics. This was refactored from a straightforward parser to this validation approach so
//! that we can emit errors as diagnostics instead of returning results.
//!
//! Using this approach we can provide *much* better errors as well as partial expansion whereever
//! Using this approach we can provide *much* better errors as well as partial expansion wherever
//! possible.
//!
//! It does lead to the code actually being larger than it was before, but it should be much easier
+1 -1
View File
@@ -598,7 +598,7 @@ fn merging_weird_fails() {
}
#[test]
fn diagnositcs() {
fn diagnostics() {
let input = quote::quote! {
p {
class: "foo bar"
+1 -1
View File
@@ -13,7 +13,7 @@ use syn::{
///
/// This wraps LitStr with some extra goodies like inline expressions and hot-reloading.
/// Originally this was intended to provide named inline string interpolation but eventually Rust
/// actualy shipped this!
/// actually shipped this!
#[derive(Debug, PartialEq, Eq, Clone, Hash)]
pub struct IfmtInput {
pub source: LitStr,
+3 -3
View File
@@ -25,7 +25,7 @@ use syn::{
/// children
/// }
///
/// Does not make any guarnatees about the contents of the block - this is meant to be verified by the
/// Does not make any guarantees about the contents of the block - this is meant to be verified by the
/// element/component impls themselves.
///
/// The name of the block is expected to be parsed by the parent parser. It will accept items out of
@@ -381,7 +381,7 @@ mod tests {
/// Some tests of partial expansion to give better autocomplete
#[test]
fn partial_cases() {
let with_hander = quote! {
let with_handler = quote! {
{
onclick: move |_| {
some.
@@ -389,7 +389,7 @@ mod tests {
}
};
let _block: RsxBlock = syn::parse2(with_hander).unwrap();
let _block: RsxBlock = syn::parse2(with_handler).unwrap();
}
/// Ensure the hotreload scoring algorithm works as expected
+2 -2
View File
@@ -92,7 +92,7 @@ fn score_attr_value(old_attr: &AttributeValue, new_attr: &AttributeValue) -> usi
// right now going from float to int or vice versa will cause a full rebuild
// which can get confusing. if we can figure out a way to hotreload this, that'd be great
(AttrLiteral(left), AttrLiteral(right)) => {
// We assign perfect matches for token resuse, to minimize churn on the renderer
// We assign perfect matches for token reuse, to minimize churn on the renderer
match (&left.value, &right.value) {
// Quick shortcut if there's no change
(Fmted(old), Fmted(new)) if old == new => usize::MAX,
@@ -127,7 +127,7 @@ fn score_attr_value(old_attr: &AttributeValue, new_attr: &AttributeValue) -> usi
score_attr_value(value_a, value_b)
}
// todo: we should try and score recrusively if we can - templates need to propagate up their
// todo: we should try and score recursively if we can - templates need to propagate up their
// scores. That would lead to a time complexity explosion but can be helpful in some cases.
//
// If it's expression-type things, we give a perfect score if they match completely
+1 -1
View File
@@ -3,7 +3,7 @@
//! The `Callbody` is the contents of the rsx! macro - this contains all the information about every
//! node that rsx! directly knows about. For loops, if statements, etc.
//!
//! However, thre are multiple *templates* inside a callbody - due to how core clones templates and
//! However, there are multiple *templates* inside a callbody - due to how core clones templates and
//! just generally rationalize the concept of a template, nested bodies like for loops and if statements
//! and component children are all templates, contained within the same Callbody.
//!
+4 -4
View File
@@ -194,13 +194,13 @@ fn invalid_cases() {
span { "asasddasdasd" }
// this is a new dynamic node, and thus can't be hot reloaded
// Eventualy we might be able to do a format like this, but not right now
// Eventually we might be able to do a format like this, but not right now
span { "123 {item}" }
}
}
};
let new_invlaid_added = quote! {
let new_invalid_added = quote! {
div {
for item in vec![1, 2, 3] {
div { "asasddasdasd" }
@@ -225,7 +225,7 @@ fn invalid_cases() {
let new_valid_removed: CallBody = syn::parse2(new_valid_removed).unwrap();
let new_invalid_new_dynamic_internal: CallBody =
syn::parse2(new_invalid_new_dynamic_internal).unwrap();
let new_invlaid_added: CallBody = syn::parse2(new_invlaid_added).unwrap();
let new_invalid_added: CallBody = syn::parse2(new_invalid_added).unwrap();
assert!(hotreload_callbody::<Mock>(&old, &new_invalid, location).is_none());
assert!(
@@ -244,7 +244,7 @@ fn invalid_cases() {
assert_eq!(template.node_paths, &[&[], &[0u8, 0] as &[u8]]);
// Adding a new dynamic node should not be hot reloadable
let added = hotreload_callbody::<Mock>(&old, &new_invlaid_added, location);
let added = hotreload_callbody::<Mock>(&old, &new_invalid_added, location);
assert!(added.is_none());
}