Skip to content

Commit

Permalink
Fix typos and add typos to CI (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shatur authored Dec 1, 2024
1 parent 30caf07 commit 7918716
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 19 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ on:
env:
CARGO_TERM_COLOR: always
jobs:
typos:
name: Typos
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4

- name: Check typos
uses: crate-ci/[email protected]

format:
name: Format
runs-on: ubuntu-latest
Expand Down Expand Up @@ -121,7 +131,7 @@ jobs:
codecov:
name: Upload to Codecov
if: github.actor != 'dependabot[bot]'
needs: [format, lint, doctest, feature-combinations, test]
needs: [typos, format, lint, doctest, feature-combinations, test]
runs-on: ubuntu-latest
steps:
- name: Clone repo
Expand Down
2 changes: 1 addition & 1 deletion src/core/event_registry/client_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ impl<E: Event> FromWorld for ClientEventReader<E> {
}

/// An event indicating that a message from client was received.
/// Emited only on server.
/// Emitted only on server.
#[derive(Clone, Copy, Event)]
pub struct FromClient<T> {
pub client_id: ClientId,
Expand Down
2 changes: 1 addition & 1 deletion src/core/event_registry/server_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ enum SerializedMessage {
Raw(Vec<u8>),
/// A message with serialized tick.
///
/// `tick | messsage`
/// `tick | message`
Resolved { tick: RepliconTick, bytes: Bytes },
}

Expand Down
10 changes: 5 additions & 5 deletions src/core/replication/replicated_clients/client_visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ impl ClientVisibility {
/// Sets visibility for a specific entity.
///
/// Does nothing if the visibility policy for the server plugin is set to [`VisibilityPolicy::All`].
pub fn set_visibility(&mut self, entity: Entity, visibile: bool) {
pub fn set_visibility(&mut self, entity: Entity, visible: bool) {
match &mut self.filter {
VisibilityFilter::All { .. } => {
if visibile {
if visible {
debug!(
"ignoring visibility enable due to {:?}",
VisibilityPolicy::All
Expand All @@ -154,8 +154,8 @@ impl ClientVisibility {
added,
removed,
} => {
if visibile {
// If the entity is already visibile, do nothing.
if visible {
// If the entity is already visible, do nothing.
let Entry::Occupied(mut entry) = list.entry(entity) else {
return;
};
Expand Down Expand Up @@ -187,7 +187,7 @@ impl ClientVisibility {
added,
removed,
} => {
if visibile {
if visible {
// Similar to blacklist removal, we don't just add the entity to the list.
// Instead we mark it as `WhitelistInfo::JustAdded` and then set it to
// 'WhitelistInfo::Visible' in `Self::update`.
Expand Down
2 changes: 1 addition & 1 deletion src/core/replication/replication_registry/test_fns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub trait TestFnsEntityExt {
/// See also [`AppMarkerExt`](crate::core::replication::command_markers::AppMarkerExt).
fn apply_write(&mut self, data: &[u8], fns_id: FnsId, message_tick: RepliconTick) -> &mut Self;

/// Remvoes a component using a registered function for it.
/// Removes a component using a registered function for it.
///
/// See also [`AppMarkerExt`](crate::core::replication::command_markers::AppMarkerExt).
fn apply_remove(&mut self, fns_id: FnsId, message_tick: RepliconTick) -> &mut Self;
Expand Down
2 changes: 1 addition & 1 deletion src/core/replicon_tick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ mod tests {
use super::*;

#[test]
fn tick_comparsion() {
fn tick_comparison() {
assert_eq!(RepliconTick::new(0), RepliconTick::new(0));
assert!(RepliconTick::new(0) < RepliconTick::new(1));
assert!(RepliconTick::new(0) > RepliconTick::new(u32::MAX));
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ World state on the client is only "eventually consistent" with the server's.
# Troubleshooting
If you face any issue, try to enable logging to see what is going on.
To enable logging, you can temporarely set `RUST_LOG` environment variable to `bevy_replicon=debug`
To enable logging, you can temporarily set `RUST_LOG` environment variable to `bevy_replicon=debug`
(or `bevy_replicon=trace` for more noisy output) like this:
```bash
Expand Down
2 changes: 1 addition & 1 deletion src/server/replicated_archetypes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ mod tests {
}

#[test]
fn grup_with_subset() {
fn group_with_subset() {
let mut app = App::new();
app.init_resource::<ReplicationRules>()
.init_resource::<ReplicationRegistry>()
Expand Down
2 changes: 1 addition & 1 deletion src/server/replication_messages/serialized_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
server::client_entity_map::ClientMapping,
};

/// Single continious buffer that stores serialized data for messages.
/// Single continuous buffer that stores serialized data for messages.
///
/// See [`UpdateMessage`](super::update_message::UpdateMessage) and
/// [`MutateMessage`](super::mutate_message::MutateMessage).
Expand Down
2 changes: 1 addition & 1 deletion tests/despawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn single() {
}

#[test]
fn with_heirarchy() {
fn with_hierarchy() {
let mut server_app = App::new();
let mut client_app = App::new();
for app in [&mut server_app, &mut client_app] {
Expand Down
10 changes: 5 additions & 5 deletions tests/server_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn sending_receiving() {
assert_eq!(
events.drain().count(),
events_count,
"event should be emited {events_count} times for {mode:?}"
"event should be emitted {events_count} times for {mode:?}"
);
}
}
Expand Down Expand Up @@ -150,7 +150,7 @@ fn sending_receiving_without_plugins() {
assert_eq!(
events.drain().count(),
events_count,
"event should be emited {events_count} times for {mode:?}"
"event should be emitted {events_count} times for {mode:?}"
);
}
}
Expand Down Expand Up @@ -189,7 +189,7 @@ fn local_resending() {
assert_eq!(
dummy_events.drain().count(),
events_count,
"event should be emited {events_count} times for {mode:?}"
"event should be emitted {events_count} times for {mode:?}"
);
}
}
Expand Down Expand Up @@ -466,7 +466,7 @@ fn independent() {
assert_eq!(
events.drain().count(),
events_count,
"event should be emited {events_count} times for {mode:?}"
"event should be emitted {events_count} times for {mode:?}"
);
}
}
Expand Down Expand Up @@ -570,7 +570,7 @@ fn different_ticks() {
server_app.exchange_with_client(&mut client_app1);

// Connect client 2 later to make it have a higher replicon tick than client 1,
// since only client 1 will recieve a update message here.
// since only client 1 will receive a update message here.
server_app.connect_client(&mut client_app2);

server_app.world_mut().send_event(ToClients {
Expand Down

0 comments on commit 7918716

Please sign in to comment.