mirror of
https://github.com/bevyengine/bevy
synced 2024-12-24 03:53:06 +00:00
⬆️ 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
This commit is contained in:
parent
4aed2ca74c
commit
a6b5f80715
7 changed files with 22 additions and 28 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -242,7 +242,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Check for typos
|
- name: Check for typos
|
||||||
uses: crate-ci/typos@v1.27.3
|
uses: crate-ci/typos@v1.28.2
|
||||||
- name: Typos info
|
- name: Typos info
|
||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
|
|
|
@ -414,7 +414,7 @@ impl Bounded2d for Capsule2d {
|
||||||
fn aabb_2d(&self, isometry: impl Into<Isometry2d>) -> Aabb2d {
|
fn aabb_2d(&self, isometry: impl Into<Isometry2d>) -> Aabb2d {
|
||||||
let isometry = isometry.into();
|
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 {
|
let segment = Segment2d {
|
||||||
// Multiplying a normalized vector (Vec2::Y) with a rotation returns a normalized vector.
|
// Multiplying a normalized vector (Vec2::Y) with a rotation returns a normalized vector.
|
||||||
direction: isometry.rotation * Dir2::Y,
|
direction: isometry.rotation * Dir2::Y,
|
||||||
|
|
|
@ -1909,14 +1909,14 @@ impl Measured2d for RegularPolygon {
|
||||||
pub struct Capsule2d {
|
pub struct Capsule2d {
|
||||||
/// The radius of the capsule
|
/// The radius of the capsule
|
||||||
pub radius: f32,
|
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,
|
pub half_length: f32,
|
||||||
}
|
}
|
||||||
impl Primitive2d for Capsule2d {}
|
impl Primitive2d for Capsule2d {}
|
||||||
|
|
||||||
impl Default for Capsule2d {
|
impl Default for Capsule2d {
|
||||||
/// Returns the default [`Capsule2d`] with a radius of `0.5` and a half-height of `0.5`,
|
/// 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 {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
radius: 0.5,
|
radius: 0.5,
|
||||||
|
|
|
@ -37,7 +37,7 @@ where
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
pub enum MeshWindingInvertError {
|
pub enum MeshWindingInvertError {
|
||||||
/// This error occurs when you try to invert the winding for a mesh with [`PrimitiveTopology::PointList`](super::PrimitiveTopology::PointList).
|
/// 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,
|
WrongTopology,
|
||||||
|
|
||||||
/// This error occurs when you try to invert the winding for a mesh with
|
/// This error occurs when you try to invert the winding for a mesh with
|
||||||
|
|
|
@ -938,7 +938,7 @@ impl MeshBuilder for Capsule2dMeshBuilder {
|
||||||
let resolution = self.resolution;
|
let resolution = self.resolution;
|
||||||
let vertex_count = 2 * 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 indices = Vec::with_capacity((resolution as usize - 2) * 2 * 3 + 6);
|
||||||
let mut positions = Vec::with_capacity(vertex_count as usize);
|
let mut positions = Vec::with_capacity(vertex_count as usize);
|
||||||
let normals = vec![[0.0, 0.0, 1.0]; 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.
|
// 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);
|
let radius_frac = self.capsule.radius / (self.capsule.half_length + self.capsule.radius);
|
||||||
|
|
||||||
// Create top semicircle
|
// Create top semicircle
|
||||||
|
@ -975,7 +975,7 @@ impl MeshBuilder for Capsule2dMeshBuilder {
|
||||||
indices.extend_from_slice(&[0, i, i + 1]);
|
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]);
|
indices.extend_from_slice(&[0, resolution - 1, resolution]);
|
||||||
|
|
||||||
// Create bottom semicircle
|
// Create bottom semicircle
|
||||||
|
@ -994,7 +994,7 @@ impl MeshBuilder for Capsule2dMeshBuilder {
|
||||||
indices.extend_from_slice(&[resolution, resolution + i, resolution + i + 1]);
|
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]);
|
indices.extend_from_slice(&[resolution, vertex_count - 1, 0]);
|
||||||
|
|
||||||
Mesh::new(
|
Mesh::new(
|
||||||
|
|
|
@ -35,7 +35,7 @@ impl ChildBufferCache {
|
||||||
|
|
||||||
/// Generates the render stack for UI nodes.
|
/// 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,
|
/// Then build the `UiStack` from a walk of the existing layout trees starting from each root node,
|
||||||
/// filtering branches by `Without<GlobalZIndex>`so that we don't revisit nodes.
|
/// filtering branches by `Without<GlobalZIndex>`so that we don't revisit nodes.
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
|
|
26
typos.toml
26
typos.toml
|
@ -7,21 +7,6 @@ extend-exclude = [
|
||||||
]
|
]
|
||||||
ignore-hidden = false
|
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
|
# Match Inside a Word - Case Insensitive
|
||||||
[default.extend-words]
|
[default.extend-words]
|
||||||
LOD = "LOD" # Level of detail
|
LOD = "LOD" # Level of detail
|
||||||
|
@ -29,10 +14,19 @@ TOI = "TOI" # Time of impact
|
||||||
|
|
||||||
[default]
|
[default]
|
||||||
locale = "en-us"
|
locale = "en-us"
|
||||||
|
# Ignored typos regexes
|
||||||
extend-ignore-identifiers-re = [
|
extend-ignore-identifiers-re = [
|
||||||
|
"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
|
"NDK", # NDK - Native Development Kit
|
||||||
"inventario", # Inventory in Portuguese
|
|
||||||
"PNG", # PNG - Portable Network Graphics file format
|
"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
|
# Used in bevy_mikktspace
|
||||||
"iFO",
|
"iFO",
|
||||||
"vOt",
|
"vOt",
|
||||||
|
|
Loading…
Reference in a new issue