From a6b5f807159433e393ee478682f5074e1d5efa32 Mon Sep 17 00:00:00 2001 From: homersimpsons Date: Sun, 8 Dec 2024 18:25:10 +0100 Subject: [PATCH] :arrow_up: Upgrade typos and its configuration (#16712) # Objective Fixes #16610, related to #16702 ## Solution Upgrade typos and its configuration ## Testing - Did you test these changes? If so, how? No - Are there any parts that need more testing? No - How can other people (reviewers) test your changes? Is there anything specific they need to know? No - If relevant, what platforms did you test these changes on, and are there any important ones you can't test? Not applicable --- .github/workflows/ci.yml | 2 +- .../src/bounding/bounded2d/primitive_impls.rs | 2 +- crates/bevy_math/src/primitives/dim2.rs | 4 +-- crates/bevy_mesh/src/index.rs | 2 +- crates/bevy_mesh/src/primitives/dim2.rs | 8 ++--- crates/bevy_ui/src/stack.rs | 2 +- typos.toml | 30 ++++++++----------- 7 files changed, 22 insertions(+), 28 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8cb0c7acf..74bf325d8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -242,7 +242,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Check for typos - uses: crate-ci/typos@v1.27.3 + uses: crate-ci/typos@v1.28.2 - name: Typos info if: failure() run: | diff --git a/crates/bevy_math/src/bounding/bounded2d/primitive_impls.rs b/crates/bevy_math/src/bounding/bounded2d/primitive_impls.rs index aeee66f51e..8f55a6fb0d 100644 --- a/crates/bevy_math/src/bounding/bounded2d/primitive_impls.rs +++ b/crates/bevy_math/src/bounding/bounded2d/primitive_impls.rs @@ -414,7 +414,7 @@ impl Bounded2d for Capsule2d { fn aabb_2d(&self, isometry: impl Into) -> Aabb2d { let isometry = isometry.into(); - // Get the line segment between the hemicircles of the rotated capsule + // Get the line segment between the semicircles of the rotated capsule let segment = Segment2d { // Multiplying a normalized vector (Vec2::Y) with a rotation returns a normalized vector. direction: isometry.rotation * Dir2::Y, diff --git a/crates/bevy_math/src/primitives/dim2.rs b/crates/bevy_math/src/primitives/dim2.rs index f407917c73..c1c4f9b158 100644 --- a/crates/bevy_math/src/primitives/dim2.rs +++ b/crates/bevy_math/src/primitives/dim2.rs @@ -1909,14 +1909,14 @@ impl Measured2d for RegularPolygon { pub struct Capsule2d { /// The radius of the capsule pub radius: f32, - /// Half the height of the capsule, excluding the hemicircles + /// Half the height of the capsule, excluding the semicircles pub half_length: f32, } impl Primitive2d for Capsule2d {} impl Default for Capsule2d { /// Returns the default [`Capsule2d`] with a radius of `0.5` and a half-height of `0.5`, - /// excluding the hemicircles. + /// excluding the semicircles. fn default() -> Self { Self { radius: 0.5, diff --git a/crates/bevy_mesh/src/index.rs b/crates/bevy_mesh/src/index.rs index 854eaaad8a..d9593543a8 100644 --- a/crates/bevy_mesh/src/index.rs +++ b/crates/bevy_mesh/src/index.rs @@ -37,7 +37,7 @@ where #[derive(Debug, Error)] pub enum MeshWindingInvertError { /// This error occurs when you try to invert the winding for a mesh with [`PrimitiveTopology::PointList`](super::PrimitiveTopology::PointList). - #[error("Mesh winding invertation does not work for primitive topology `PointList`")] + #[error("Mesh winding inversion does not work for primitive topology `PointList`")] WrongTopology, /// This error occurs when you try to invert the winding for a mesh with diff --git a/crates/bevy_mesh/src/primitives/dim2.rs b/crates/bevy_mesh/src/primitives/dim2.rs index cb517e89d2..72a304c699 100644 --- a/crates/bevy_mesh/src/primitives/dim2.rs +++ b/crates/bevy_mesh/src/primitives/dim2.rs @@ -938,7 +938,7 @@ impl MeshBuilder for Capsule2dMeshBuilder { let resolution = self.resolution; let vertex_count = 2 * resolution; - // Six extra indices for the two triangles between the hemicircles + // Six extra indices for the two triangles between the semicircles let mut indices = Vec::with_capacity((resolution as usize - 2) * 2 * 3 + 6); let mut positions = Vec::with_capacity(vertex_count as usize); let normals = vec![[0.0, 0.0, 1.0]; vertex_count as usize]; @@ -956,7 +956,7 @@ impl MeshBuilder for Capsule2dMeshBuilder { }; // How much the hemicircle radius is of the total half-height of the capsule. - // This is used to prevent the UVs from stretching between the hemicircles. + // This is used to prevent the UVs from stretching between the semicircles. let radius_frac = self.capsule.radius / (self.capsule.half_length + self.capsule.radius); // Create top semicircle @@ -975,7 +975,7 @@ impl MeshBuilder for Capsule2dMeshBuilder { indices.extend_from_slice(&[0, i, i + 1]); } - // Add indices for top left triangle of the part between the hemicircles + // Add indices for top left triangle of the part between the semicircles indices.extend_from_slice(&[0, resolution - 1, resolution]); // Create bottom semicircle @@ -994,7 +994,7 @@ impl MeshBuilder for Capsule2dMeshBuilder { indices.extend_from_slice(&[resolution, resolution + i, resolution + i + 1]); } - // Add indices for bottom right triangle of the part between the hemicircles + // Add indices for bottom right triangle of the part between the semicircles indices.extend_from_slice(&[resolution, vertex_count - 1, 0]); Mesh::new( diff --git a/crates/bevy_ui/src/stack.rs b/crates/bevy_ui/src/stack.rs index e419ce67fd..83ccc9a23c 100644 --- a/crates/bevy_ui/src/stack.rs +++ b/crates/bevy_ui/src/stack.rs @@ -35,7 +35,7 @@ impl ChildBufferCache { /// Generates the render stack for UI nodes. /// -/// Create a list of root nodes from unparented entities and entities with a `GlobalZIndex` component. +/// Create a list of root nodes from parentless entities and entities with a `GlobalZIndex` component. /// Then build the `UiStack` from a walk of the existing layout trees starting from each root node, /// filtering branches by `Without`so that we don't revisit nodes. #[allow(clippy::too_many_arguments)] diff --git a/typos.toml b/typos.toml index ddaaffd54a..332f68bead 100644 --- a/typos.toml +++ b/typos.toml @@ -7,21 +7,6 @@ extend-exclude = [ ] ignore-hidden = false -# Corrections take the form of a key/value pair. The key is the incorrect word -# and the value is the correct word. If the key and value are the same, the -# word is treated as always correct. If the value is an empty string, the word -# is treated as always incorrect. - -# Match Whole Word - Case Sensitive -[default.extend-identifiers] -iy = "iy" # Variable name used in bevy_gizmos. Probably stands for "y-axis index", as it's being used in loops. -ser = "ser" # ron::ser - Serializer -SME = "SME" # Subject Matter Expert -Sur = "Sur" # macOS Big Sur - South -Masia = "Masia" # The surname of one of the authors of SMAA -Ba = "Ba" # Bitangent for Anisotropy -ba = "ba" # Part of an accessor in WGSL - color.ba - # Match Inside a Word - Case Insensitive [default.extend-words] LOD = "LOD" # Level of detail @@ -29,10 +14,19 @@ TOI = "TOI" # Time of impact [default] locale = "en-us" +# Ignored typos regexes extend-ignore-identifiers-re = [ - "NDK", # NDK - Native Development Kit - "inventario", # Inventory in Portuguese - "PNG", # PNG - Portable Network Graphics file format + "Ba", # Bitangent for Anisotropy + "ba", # Part of an accessor in WGSL - color.ba + "ser", # ron::ser - Serializer + "SME", # Subject Matter Expert + "Sur", # macOS Big Sur - South + "NDK", # NDK - Native Development Kit + "PNG", # PNG - Portable Network Graphics file format + "Masia", # The surname of one of the authors of SMAA + "metalness", # Rendering term (metallicity) + "inventario", # Inventory in Portuguese + "[Rr]eparametrize", # Mathematical term in curve context (reparameterize) # Used in bevy_mikktspace "iFO", "vOt",