Skip to content

Commit

Permalink
Fix typos throughout the project (#9090)
Browse files Browse the repository at this point in the history
# Objective

Fix typos throughout the project.

## Solution

[`typos`](https://github.com/crate-ci/typos) project was used for
scanning, but no automatic corrections were applied. I checked
everything by hand before fixing.

Most of the changes are documentation/comments corrections. Also, there
are few trivial changes to code (variable name, pub(crate) function name
and a few error/panic messages).

## Unsolved

`bevy_reflect_derive` has
[typo](https://github.com/ClayenKitten/bevy/blob/1b51053f1958d750cdddffb99828bd0aacb61a78/crates/bevy_reflect/bevy_reflect_derive/src/type_path.rs#L76)
in enum variant name that I didn't fix. Enum is `pub(crate)`, so there
shouldn't be any trouble if fixed. However, code is tightly coupled with
macro usage, so I decided to leave it for more experienced contributor
just in case.
  • Loading branch information
ClayenKitten committed Jul 10, 2023
1 parent 8ba9571 commit ffc5727
Show file tree
Hide file tree
Showing 40 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_app/src/main_schedule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct First;

/// The schedule that contains logic that must run before [`Update`]. For example, a system that reads raw keyboard
/// input OS events into an `Events` resource. This enables systems in [`Update`] to consume the events from the `Events`
/// resource without actually knowing about (or taking a direct scheduler dependency on) the "os-level keyboard event sytsem".
/// resource without actually knowing about (or taking a direct scheduler dependency on) the "os-level keyboard event system".
///
/// [`PreUpdate`] exists to do "engine/plugin preparation work" that ensures the APIs consumed in [`Update`] are "ready".
/// [`PreUpdate`] abstracts out "pre work implementation details".
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_core_pipeline/src/bloom/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl BloomSettings {
composite_mode: BloomCompositeMode::EnergyConserving,
};

/// A preset that's similiar to how older games did bloom.
/// A preset that's similar to how older games did bloom.
pub const OLD_SCHOOL: Self = Self {
intensity: 0.05,
low_frequency_boost: 0.7,
Expand Down Expand Up @@ -159,7 +159,7 @@ impl Default for BloomSettings {
/// # Considerations
/// * Changing these settings creates a physically inaccurate image
/// * Changing these settings makes it easy to make the final result look worse
/// * Non-default prefilter settings should be used in conjuction with [`BloomCompositeMode::Additive`]
/// * Non-default prefilter settings should be used in conjunction with [`BloomCompositeMode::Additive`]
#[derive(Default, Clone, Reflect)]
pub struct BloomPrefilterSettings {
/// Baseline of the quadratic threshold curve (default: 0.0).
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_core_pipeline/src/taa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub struct TemporalAntiAliasSettings {
/// Set to true to delete the saved temporal history (past frames).
///
/// Useful for preventing ghosting when the history is no longer
/// representive of the current frame, such as in sudden camera cuts.
/// representative of the current frame, such as in sudden camera cuts.
///
/// After setting this to true, it will automatically be toggled
/// back to false after one frame.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/macros/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fn parse_component_attr(ast: &DeriveInput) -> Result<Attrs> {
};
Ok(())
} else {
Err(nested.error("Unsuported attribute"))
Err(nested.error("Unsupported attribute"))
}
})?;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/entity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ mod tests {

assert!(entities.reserve_generations(entity.index, GENERATIONS));

// The very next entitiy allocated should be a further generation on the same index
// The very next entity allocated should be a further generation on the same index
let next_entity = entities.alloc();
assert_eq!(next_entity.index(), entity.index());
assert!(next_entity.generation > entity.generation + GENERATIONS);
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/reflect/map_entities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
use bevy_reflect::FromType;

/// For a specific type of component, this maps any fields with values of type [`Entity`] to a new world.
/// Since a given `Entity` ID is only valid for the world it came frome, when performing deserialization
/// Since a given `Entity` ID is only valid for the world it came from, when performing deserialization
/// any stored IDs need to be re-allocated in the destination world.
///
/// See [`MapEntities`] for more information.
Expand Down
16 changes: 8 additions & 8 deletions crates/bevy_ecs/src/schedule/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ pub mod common_conditions {
/// # let mut app = Schedule::new();
/// # let mut world = World::new();
/// app.add_systems(
/// // `resource_exsists` will only return true if the given resource exsists in the world
/// // `resource_exists` will only return true if the given resource exists in the world
/// my_system.run_if(resource_exists::<Counter>()),
/// );
///
Expand Down Expand Up @@ -324,7 +324,7 @@ pub mod common_conditions {
/// # let mut world = World::new();
/// app.add_systems(
/// // `resource_exists_and_equals` will only return true
/// // if the given resource exsists and equals the given value
/// // if the given resource exists and equals the given value
/// my_system.run_if(resource_exists_and_equals(Counter(0))),
/// );
///
Expand Down Expand Up @@ -422,7 +422,7 @@ pub mod common_conditions {
/// my_system.run_if(
/// resource_changed::<Counter>()
/// // By default detecting changes will also trigger if the resource was
/// // just added, this won't work with my example so I will addd a second
/// // just added, this won't work with my example so I will add a second
/// // condition to make sure the resource wasn't just added
/// .and_then(not(resource_added::<Counter>()))
/// ),
Expand Down Expand Up @@ -471,11 +471,11 @@ pub mod common_conditions {
/// # let mut world = World::new();
/// app.add_systems(
/// // `resource_exists_and_changed` will only return true if the
/// // given resource exsists and was just changed (or added)
/// // given resource exists and was just changed (or added)
/// my_system.run_if(
/// resource_exists_and_changed::<Counter>()
/// // By default detecting changes will also trigger if the resource was
/// // just added, this won't work with my example so I will addd a second
/// // just added, this won't work with my example so I will add a second
/// // condition to make sure the resource wasn't just added
/// .and_then(not(resource_added::<Counter>()))
/// ),
Expand Down Expand Up @@ -537,7 +537,7 @@ pub mod common_conditions {
/// my_system.run_if(
/// resource_changed_or_removed::<Counter>()
/// // By default detecting changes will also trigger if the resource was
/// // just added, this won't work with my example so I will addd a second
/// // just added, this won't work with my example so I will add a second
/// // condition to make sure the resource wasn't just added
/// .and_then(not(resource_added::<Counter>()))
/// ),
Expand Down Expand Up @@ -665,7 +665,7 @@ pub mod common_conditions {
///
/// app.add_systems(
/// // `state_exists` will only return true if the
/// // given state exsists
/// // given state exists
/// my_system.run_if(state_exists::<GameState>()),
/// );
///
Expand Down Expand Up @@ -764,7 +764,7 @@ pub mod common_conditions {
///
/// app.add_systems((
/// // `state_exists_and_equals` will only return true if the
/// // given state exsists and equals the given value
/// // given state exists and equals the given value
/// play_system.run_if(state_exists_and_equals(GameState::Playing)),
/// pause_system.run_if(state_exists_and_equals(GameState::Paused)),
/// ));
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/schedule/executor/multi_threaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ impl MultiThreadedExecutor {
/// - `world` must have permission to access the world data
/// used by the specified system.
/// - `update_archetype_component_access` must have been called with `world`
/// on the system assocaited with `system_index`.
/// on the system associated with `system_index`.
unsafe fn spawn_system_task<'scope>(
&mut self,
scope: &Scope<'_, 'scope, ()>,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/schedule/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ mod tests {
partially_ordered == [8, 9, 10] || partially_ordered == [10, 8, 9],
"partially_ordered must be [8, 9, 10] or [10, 8, 9]"
);
assert!(order.len() == 11, "must have exacty 11 order entries");
assert!(order.len() == 11, "must have exactly 11 order entries");
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/storage/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl TableRow {
}
}

/// A type-erased contiguous container for data of a homogenous type.
/// A type-erased contiguous container for data of a homogeneous type.
///
/// Conceptually, a [`Column`] is very similar to a type-erased `Vec<T>`.
/// It also stores the change detection ticks for its components, kept in two separate
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_ecs/src/system/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Query<'w, 's, Q, F> {
pub fn iter(&self) -> QueryIter<'_, 's, Q::ReadOnly, F::ReadOnly> {
// SAFETY:
// - `self.world` has permission to access the required components.
// - The query is read-only, so it can be aliased even if it was originaly mutable.
// - The query is read-only, so it can be aliased even if it was originally mutable.
unsafe {
self.state
.as_readonly()
Expand Down Expand Up @@ -492,7 +492,7 @@ impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Query<'w, 's, Q, F> {
) -> QueryCombinationIter<'_, 's, Q::ReadOnly, F::ReadOnly, K> {
// SAFETY:
// - `self.world` has permission to access the required components.
// - The query is read-only, so it can be aliased even if it was originaly mutable.
// - The query is read-only, so it can be aliased even if it was originally mutable.
unsafe {
self.state.as_readonly().iter_combinations_unchecked_manual(
self.world,
Expand Down Expand Up @@ -578,7 +578,7 @@ impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Query<'w, 's, Q, F> {
{
// SAFETY:
// - `self.world` has permission to access the required components.
// - The query is read-only, so it can be aliased even if it was originaly mutable.
// - The query is read-only, so it can be aliased even if it was originally mutable.
unsafe {
self.state.as_readonly().iter_many_unchecked_manual(
entities,
Expand Down Expand Up @@ -734,7 +734,7 @@ impl<'w, 's, Q: WorldQuery, F: ReadOnlyWorldQuery> Query<'w, 's, Q, F> {
pub fn for_each<'this>(&'this self, f: impl FnMut(ROQueryItem<'this, Q>)) {
// SAFETY:
// - `self.world` has permission to access the required components.
// - The query is read-only, so it can be aliased even if it was originaly mutable.
// - The query is read-only, so it can be aliased even if it was originally mutable.
unsafe {
self.state.as_readonly().for_each_unchecked_manual(
self.world,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ unsafe impl SystemParam for &'_ World {
world: UnsafeWorldCell<'w>,
_change_tick: Tick,
) -> Self::Item<'w, 's> {
// SAFETY: Read-only access to the entire world was registerd in `init_state`.
// SAFETY: Read-only access to the entire world was registered in `init_state`.
world.world()
}
}
Expand Down
8 changes: 4 additions & 4 deletions crates/bevy_gizmos/src/gizmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ pub struct CircleBuilder<'a, 's> {
}

impl CircleBuilder<'_, '_> {
/// Set the number of line-segements for this circle.
/// Set the number of line-segments for this circle.
pub fn segments(mut self, segments: usize) -> Self {
self.segments = segments;
self
Expand All @@ -598,7 +598,7 @@ pub struct SphereBuilder<'a, 's> {
}

impl SphereBuilder<'_, '_> {
/// Set the number of line-segements per circle for this sphere.
/// Set the number of line-segments per circle for this sphere.
pub fn circle_segments(mut self, segments: usize) -> Self {
self.circle_segments = segments;
self
Expand All @@ -625,7 +625,7 @@ pub struct Circle2dBuilder<'a, 's> {
}

impl Circle2dBuilder<'_, '_> {
/// Set the number of line-segements for this circle.
/// Set the number of line-segments for this circle.
pub fn segments(mut self, segments: usize) -> Self {
self.segments = segments;
self
Expand All @@ -651,7 +651,7 @@ pub struct Arc2dBuilder<'a, 's> {
}

impl Arc2dBuilder<'_, '_> {
/// Set the number of line-segements for this arc.
/// Set the number of line-segments for this arc.
pub fn segments(mut self, segments: usize) -> Self {
self.segments = Some(segments);
self
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_gizmos/src/lines.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ fn vertex(vertex: VertexInput) -> VertexOutput {
// depth * (clip.w / depth)^-depth_bias. So that when -depth_bias is 1.0, this is equal to clip.w
// and when equal to 0.0, it is exactly equal to depth.
// the epsilon is here to prevent the depth from exceeding clip.w when -depth_bias = 1.0
// clip.w represents the near plane in homogenous clip space in bevy, having a depth
// clip.w represents the near plane in homogeneous clip space in bevy, having a depth
// of this value means nothing can be in front of this
// The reason this uses an exponential function is that it makes it much easier for the
// user to chose a value that is convinient for them
// user to chose a value that is convenient for them
depth = clip.z * exp2(-line_gizmo.depth_bias * log2(clip.w / clip.z - epsilon));
}

Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_hierarchy/src/child_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ impl<'w, 's, 'a> ChildBuilder<'w, 's, 'a> {

/// Trait for removing, adding and replacing children and parents of an entity.
pub trait BuildChildren {
/// Takes a clousre which builds children for this entity using [`ChildBuilder`].
/// Takes a closure which builds children for this entity using [`ChildBuilder`].
fn with_children(&mut self, f: impl FnOnce(&mut ChildBuilder)) -> &mut Self;
/// Pushes children to the back of the builder's children. For any entities that are
/// already a child of this one, this method does nothing.
Expand Down Expand Up @@ -458,7 +458,7 @@ impl<'w> WorldChildBuilder<'w> {

/// Trait that defines adding, changing and children and parents of an entity directly through the [`World`].
pub trait BuildWorldChildren {
/// Takes a clousre which builds children for this entity using [`WorldChildBuilder`].
/// Takes a closure which builds children for this entity using [`WorldChildBuilder`].
fn with_children(&mut self, spawn_children: impl FnOnce(&mut WorldChildBuilder)) -> &mut Self;

/// Adds a single child.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/render/morph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fn add_to_alignment<T: Pod + Default>(buffer: &mut BufferVec<T>) {
// This panic is stripped at compile time, due to n, t_size and can_align being const
panic!(
"BufferVec should contain only types with a size multiple or divisible by {n}, \
{} has a size of {t_size}, which is neiter multiple or divisible by {n}",
{} has a size of {t_size}, which is neither multiple or divisible by {n}",
std::any::type_name::<T>()
);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/render/morph.wgsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// If using this WGSL snippet as an #import, the following should be in scope:
//
// - the `morph_weigths` uniform of type `MorphWeights`
// - the `morph_weights` uniform of type `MorphWeights`
// - the `morph_targets` 3d texture
//
// They are defined in `mesh_types.wgsl` and `mesh_bindings.wgsl`.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/render/pbr_lighting.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ fn point_light(
// where
// f(v,l) = (f_d(v,l) + f_r(v,l)) * light_color
// Φ is luminous power in lumens
// our rangeAttentuation = 1 / d^2 multiplied with an attenuation factor for smoothing at the edge of the non-physical maximum light radius
// our rangeAttenuation = 1 / d^2 multiplied with an attenuation factor for smoothing at the edge of the non-physical maximum light radius

// For a point light, luminous intensity, I, in lumens per steradian is given by:
// I = Φ / 4 π
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl ReflectTraits {
lit: syn::Lit::Bool(lit),
..
}) => {
// Overrride `lit` if this is a `FromReflect` derive.
// Override `lit` if this is a `FromReflect` derive.
// This typically means a user is opting out of the default implementation
// from the `Reflect` derive and using the `FromReflect` derive directly instead.
is_from_reflect_derive
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_reflect/bevy_reflect_derive/src/derive_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ impl<'a> EnumVariant<'a> {
/// custom_path: None,
/// };
///
/// // Eqivalent to "core::marker".
/// // Equivalent to "core::marker".
/// let module_path = type_path.module_path();
/// # Ok::<(), syn::Error>(())
/// ```
Expand All @@ -577,7 +577,7 @@ pub(crate) enum ReflectTypePath<'a> {
Primitive(&'a Ident),
/// Using `::my_crate::foo::Bar` syntax.
///
/// May have a seperate custom path used for the `TypePath` implementation.
/// May have a separate custom path used for the `TypePath` implementation.
External {
path: &'a Path,
custom_path: Option<Path>,
Expand All @@ -587,7 +587,7 @@ pub(crate) enum ReflectTypePath<'a> {
///
/// The type must be able to be reached with just its name.
///
/// May have a seperate alias path used for the `TypePath` implementation.
/// May have a separate alias path used for the `TypePath` implementation.
///
/// Module and crate are found with [`module_path!()`](core::module_path),
/// if there is no custom path specified.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/bevy_reflect_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ pub fn impl_from_reflect_value(input: TokenStream) -> TokenStream {
/// it requires an 'absolute' path definition.
///
/// Specifically, a leading `::` denoting a global path must be specified
/// or a preceeding `(in my_crate::foo)` to specify the custom path must be used.
/// or a preceding `(in my_crate::foo)` to specify the custom path must be used.
///
/// # Examples
///
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::{
///
/// Due to the [type-erasing] nature of the reflection API as a whole,
/// this trait does not make any guarantees that the implementor's elements
/// are homogenous (i.e. all the same type).
/// are homogeneous (i.e. all the same type).
///
/// This trait has a blanket implementation over Rust arrays of up to 32 items.
/// This implementation can technically contain more than 32,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/from_reflect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{FromType, Reflect};
/// Additionally, some complex types like `Vec<T>` require that their element types
/// implement this trait.
/// The reason for such requirements is that some operations require new data to be constructed,
/// such as swapping to a new variant or pushing data to a homogenous list.
/// such as swapping to a new variant or pushing data to a homogeneous list.
///
/// See the [crate-level documentation] to see how this trait can be used.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/impls/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ impl<T: FromReflect + Clone + TypePath> List for Cow<'static, [T]> {
}

fn drain(self: Box<Self>) -> Vec<Box<dyn Reflect>> {
// into_owned() is not uneccessary here because it avoids cloning whenever you have a Cow::Owned already
// into_owned() is not unnecessary here because it avoids cloning whenever you have a Cow::Owned already
#[allow(clippy::unnecessary_to_owned)]
self.into_owned()
.into_iter()
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::{
///
/// Due to the [type-erasing] nature of the reflection API as a whole,
/// this trait does not make any guarantees that the implementor's elements
/// are homogenous (i.e. all the same type).
/// are homogeneous (i.e. all the same type).
///
/// # Example
///
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/type_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub trait TypePath: 'static {
None
}

/// Returns the path to the moudle the type is in, or [`None`] if it is [anonymous].
/// Returns the path to the module the type is in, or [`None`] if it is [anonymous].
///
/// For `Option<PhantomData>`, this is `"core::option"`.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_reflect/src/utility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl<T: TypedProperty> GenericTypeCell<T> {
{
let type_id = TypeId::of::<G>();

// Put in a seperate scope, so `mapping` is dropped before `f`,
// Put in a separate scope, so `mapping` is dropped before `f`,
// since `f` might want to call `get_or_insert` recursively
// and we don't want a deadlock!
{
Expand Down
Loading

0 comments on commit ffc5727

Please sign in to comment.