diff --git a/README.md b/README.md index 6851c5b5..4d6a9407 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ If you have any questions, feel free to If you believe you have found a security issue, please send a message to [Timo](https://matrix.to/#/@timo:conduit.rs) and/or [Matthias](https://matrix.to/#/@matthias:ahouansou.cz) on Matrix, or send an email to [conduit@koesters.xyz](mailto:conduit@koesters.xyz). Please do not disclose details about the issue to anyone else before -a fix is released publically. +a fix is released publicly. #### Thanks to diff --git a/docs/deploying/docker.md b/docs/deploying/docker.md index f914427a..d9c9cd23 100644 --- a/docs/deploying/docker.md +++ b/docs/deploying/docker.md @@ -184,7 +184,7 @@ These same values need to be set in conduit. You can either modify conduit.toml turn_uris = ["turn:?transport=udp", "turn:?transport=tcp"] turn_secret = "" ``` -or append the following to the docker environment variables dependig on which configuration method you used earlier: +or append the following to the docker environment variables depending on which configuration method you used earlier: ```yml CONDUIT_TURN_URIS: '["turn:?transport=udp", "turn:?transport=tcp"]' CONDUIT_TURN_SECRET: "" diff --git a/engage.toml b/engage.toml index 9dc2b31c..cea1b9c8 100644 --- a/engage.toml +++ b/engage.toml @@ -35,6 +35,11 @@ group = "versions" name = "lychee" script = "lychee --version" +[[task]] +group = "versions" +name = "typos" +script = "typos --version" + [[task]] group = "lints" name = "cargo-fmt" @@ -66,6 +71,11 @@ group = "lints" name = "lychee" script = "lychee --offline docs" +[[task]] +group = "lints" +name = "typos" +script = "typos" + [[task]] group = "tests" name = "cargo" diff --git a/nix/shell.nix b/nix/shell.nix index 584a6bb3..7bf80bc8 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -12,6 +12,7 @@ , system , taplo , toolchain +, typos }: mkShell { @@ -55,6 +56,9 @@ mkShell { # Needed for finding broken markdown links lychee + # Needed for checking for typos + typos + # Useful for editing the book locally mdbook ] ++ default.nativeBuildInputs ; diff --git a/src/api/client_server/appservice.rs b/src/api/client_server/appservice.rs index 1b525f7c..b7a9ef12 100644 --- a/src/api/client_server/appservice.rs +++ b/src/api/client_server/appservice.rs @@ -64,7 +64,7 @@ pub async fn ping_appservice_route( } Error::BadServerResponse(_) => Error::BadRequest( ErrorKind::ConnectionFailed, - "Recieved invalid response from appservice", + "Received invalid response from appservice", ), e => e, }) diff --git a/src/api/client_server/capabilities.rs b/src/api/client_server/capabilities.rs index 233e3c9c..60ebf627 100644 --- a/src/api/client_server/capabilities.rs +++ b/src/api/client_server/capabilities.rs @@ -6,7 +6,7 @@ use std::collections::BTreeMap; /// # `GET /_matrix/client/r0/capabilities` /// -/// Get information on the supported feature set and other relevent capabilities of this server. +/// Get information on the supported feature set and other relevant capabilities of this server. pub async fn get_capabilities_route( _body: Ruma, ) -> Result { diff --git a/src/api/server_server.rs b/src/api/server_server.rs index 9134a634..b6a038e5 100644 --- a/src/api/server_server.rs +++ b/src/api/server_server.rs @@ -507,7 +507,7 @@ async fn find_actual_destination( } } None => { - debug!("4: No .well-known or an error occured"); + debug!("4: No .well-known or an error occurred"); let (dest, expires) = get_srv_destination(destination_str).await; let well_known_retry = Instant::now() + Duration::from_secs((60 * next_backoff_mins).into()); diff --git a/src/database/mod.rs b/src/database/mod.rs index 44954e48..e452fb5d 100644 --- a/src/database/mod.rs +++ b/src/database/mod.rs @@ -111,7 +111,7 @@ pub struct KeyValueDatabase { pub(super) lazyloadedids: Arc, // LazyLoadedIds = UserId + DeviceId + RoomId + LazyLoadedUserId pub(super) userroomid_notificationcount: Arc, // NotifyCount = u64 - pub(super) userroomid_highlightcount: Arc, // HightlightCount = u64 + pub(super) userroomid_highlightcount: Arc, // HighlightCount = u64 pub(super) roomuserid_lastnotificationread: Arc, // LastNotificationRead = u64 /// Remember the current state hash of a room. diff --git a/src/lib.rs b/src/lib.rs index 141d880a..3741ee6b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,7 @@ mod service; mod utils; // Not async due to services() being used in many closures, and async closures are not stable as of writing -// This is the case for every other occurence of sync Mutex/RwLock, except for database related ones, where +// This is the case for every other occurrence of sync Mutex/RwLock, except for database related ones, where // the current maintainer (Timo) has asked to not modify those use std::sync::RwLock; diff --git a/src/main.rs b/src/main.rs index 48d082cc..6ce5f822 100644 --- a/src/main.rs +++ b/src/main.rs @@ -126,7 +126,7 @@ async fn main() { let filter_layer = match EnvFilter::try_new(&config.log) { Ok(s) => s, Err(e) => { - eprintln!("It looks like your config is invalid. The following error occured while parsing it: {e}"); + eprintln!("It looks like your config is invalid. The following error occurred while parsing it: {e}"); EnvFilter::try_new("warn").unwrap() } }; diff --git a/src/service/admin/mod.rs b/src/service/admin/mod.rs index 583bfcd1..690da984 100644 --- a/src/service/admin/mod.rs +++ b/src/service/admin/mod.rs @@ -723,7 +723,7 @@ impl Service { let mut user_ids = Vec::new(); let mut remote_ids = Vec::new(); - let mut non_existant_ids = Vec::new(); + let mut non_existent_ids = Vec::new(); let mut invalid_users = Vec::new(); for &user in &users { @@ -732,7 +732,7 @@ impl Service { if user_id.server_name() != services().globals.server_name() { remote_ids.push(user_id) } else if !services().users.exists(user_id)? { - non_existant_ids.push(user_id) + non_existent_ids.push(user_id) } else { user_ids.push(user_id) } @@ -767,12 +767,12 @@ impl Service { markdown_message.push_str("```\n\n"); html_message.push_str("\n\n"); } - if !non_existant_ids.is_empty() { + if !non_existent_ids.is_empty() { markdown_message.push_str("The following users do not exist:\n```\n"); html_message.push_str("The following users do not exist:\n
\n");
-                        for non_existant_id in non_existant_ids {
-                            markdown_message.push_str(&format!("{non_existant_id}\n"));
-                            html_message.push_str(&format!("{non_existant_id}\n"));
+                        for non_existent_id in non_existent_ids {
+                            markdown_message.push_str(&format!("{non_existent_id}\n"));
+                            html_message.push_str(&format!("{non_existent_id}\n"));
                         }
                         markdown_message.push_str("```\n\n");
                         html_message.push_str("
\n\n"); @@ -962,7 +962,7 @@ impl Service { .rooms .alias .remove_alias(&alias, services().globals.server_user())?; - RoomMessageEventContent::text_plain("Alias removed sucessfully") + RoomMessageEventContent::text_plain("Alias removed successfully") } } }; diff --git a/src/service/appservice/mod.rs b/src/service/appservice/mod.rs index f4935882..4bf22bc7 100644 --- a/src/service/appservice/mod.rs +++ b/src/service/appservice/mod.rs @@ -36,7 +36,7 @@ impl NamespaceRegex { false } - /// Checks if this namespace has exlusive rights to a namespace + /// Checks if this namespace has exclusive rights to a namespace pub fn is_exclusive_match(&self, heystack: &str) -> bool { if let Some(exclusive) = &self.exclusive { if exclusive.is_match(heystack) { diff --git a/src/service/globals/data.rs b/src/service/globals/data.rs index 167e823c..49527454 100644 --- a/src/service/globals/data.rs +++ b/src/service/globals/data.rs @@ -80,14 +80,14 @@ pub trait Data: Send + Sync { fn load_keypair(&self) -> Result; fn remove_keypair(&self) -> Result<()>; /// Only extends the cached keys, not moving any verify_keys to old_verify_keys, as if we suddenly - /// recieve requests from the origin server, we want to be able to accept requests from them + /// receive requests from the origin server, we want to be able to accept requests from them fn add_signing_key_from_trusted_server( &self, origin: &ServerName, new_keys: ServerSigningKeys, ) -> Result; /// Extends cached keys, as well as moving verify_keys that are not present in these new keys to - /// old_verify_keys, so that potnetially comprimised keys cannot be used to make requests + /// old_verify_keys, so that potnetially compromised keys cannot be used to make requests fn add_signing_key_from_origin( &self, origin: &ServerName, diff --git a/src/service/globals/mod.rs b/src/service/globals/mod.rs index acef484d..8296b39a 100644 --- a/src/service/globals/mod.rs +++ b/src/service/globals/mod.rs @@ -305,7 +305,7 @@ impl Service { self.config.max_fetch_prev_events } - /// Allows for the temporary (non-persistant) toggling of registration + /// Allows for the temporary (non-persistent) toggling of registration pub async fn set_registration(&self, status: bool) { let mut lock = self.allow_registration.write().await; *lock = status; @@ -404,7 +404,7 @@ impl Service { } /// Filters the key map of multiple servers down to keys that should be accepted given the expiry time, - /// room version, and timestamp of the paramters + /// room version, and timestamp of the parameters pub fn filter_keys_server_map( &self, keys: BTreeMap, @@ -420,7 +420,7 @@ impl Service { } /// Filters the keys of a single server down to keys that should be accepted given the expiry time, - /// room version, and timestamp of the paramters + /// room version, and timestamp of the parameters pub fn filter_keys_single_server( &self, keys: SigningKeys, diff --git a/src/service/rooms/event_handler/mod.rs b/src/service/rooms/event_handler/mod.rs index cc712b9a..6cf660c7 100644 --- a/src/service/rooms/event_handler/mod.rs +++ b/src/service/rooms/event_handler/mod.rs @@ -69,7 +69,7 @@ impl Service { /// trust a set of state we got from a remote) /// 13. Use state resolution to find new room state /// 14. Check if the event passes auth based on the "current state" of the room, if not soft fail it - // We use some AsyncRecursiveType hacks here so we can call this async funtion recursively + // We use some AsyncRecursiveType hacks here so we can call this async function recursively #[tracing::instrument(skip(self, value, is_timeline_event, pub_key_map))] pub(crate) async fn handle_incoming_pdu<'a>( &self, @@ -1786,7 +1786,7 @@ impl Service { .expect("Should be valid until year 500,000,000"); debug!( - "The treshhold is {:?}, found time is {:?} for server {}", + "The threshold is {:?}, found time is {:?} for server {}", ts_threshold, result.valid_until_ts, origin ); diff --git a/src/service/rooms/helpers/mod.rs b/src/service/rooms/helpers/mod.rs index 24b5103a..78fc1fef 100644 --- a/src/service/rooms/helpers/mod.rs +++ b/src/service/rooms/helpers/mod.rs @@ -39,7 +39,7 @@ pub struct Service; impl Service { /// Attempts to join a room. - /// If the room cannot be joined locally, it attempts to join over federation, soley using the + /// If the room cannot be joined locally, it attempts to join over federation, solely using the /// specified servers #[tracing::instrument(skip(self, reason, servers, _third_party_signed))] pub async fn join_room_by_id( diff --git a/src/service/rooms/spaces/mod.rs b/src/service/rooms/spaces/mod.rs index 26a40f9f..abd8f950 100644 --- a/src/service/rooms/spaces/mod.rs +++ b/src/service/rooms/spaces/mod.rs @@ -227,7 +227,7 @@ impl Service { .as_ref() { return Ok(if let Some(cached) = cached { - if is_accessable_child( + if is_accessible_child( current_room, &cached.summary.join_rule, &identifier, @@ -338,7 +338,7 @@ impl Service { ); } } - if is_accessable_child( + if is_accessible_child( current_room, &response.room.join_rule, &Identifier::UserId(user_id), @@ -408,7 +408,7 @@ impl Service { .state_accessor .allowed_room_ids(join_rule.clone()); - if !is_accessable_child( + if !is_accessible_child( current_room, &join_rule.clone().into(), &identifier, @@ -678,8 +678,8 @@ async fn get_stripped_space_child_events( } } -/// With the given identifier, checks if a room is accessable -fn is_accessable_child( +/// With the given identifier, checks if a room is accessible +fn is_accessible_child( current_room: &OwnedRoomId, join_rule: &SpaceRoomJoinRule, identifier: &Identifier<'_>, diff --git a/src/service/rooms/timeline/mod.rs b/src/service/rooms/timeline/mod.rs index 73966f24..903b02c4 100644 --- a/src/service/rooms/timeline/mod.rs +++ b/src/service/rooms/timeline/mod.rs @@ -463,7 +463,7 @@ impl Service { // Here we don't attempt to join if the previous membership was knock and the // new one is join, like we do for `/federation/*/invite`, as not only are there // implementation difficulties due to callers not implementing `Send`, but - // invites we recieve which aren't over `/invite` must have been due to a + // invites we receive which aren't over `/invite` must have been due to a // database reset or switching server implementations, which means we probably // shouldn't be joining automatically anyways, since it may surprise users to // suddenly join rooms which clients didn't even show as being knocked on before. diff --git a/src/service/sending/mod.rs b/src/service/sending/mod.rs index d23f1617..63536c7b 100644 --- a/src/service/sending/mod.rs +++ b/src/service/sending/mod.rs @@ -537,7 +537,7 @@ impl Service { ( kind.clone(), Error::bad_database( - "[Push] Event in servernamevent_datas not found in db.", + "[Push] Event in servernamevent_data not found in db.", ), ) })?, @@ -621,7 +621,7 @@ impl Service { ( OutgoingKind::Normal(server.clone()), Error::bad_database( - "[Normal] Event in servernamevent_datas not found in db.", + "[Normal] Event in servernamevent_data not found in db.", ), ) })?, diff --git a/typos.toml b/typos.toml new file mode 100644 index 00000000..670dffb9 --- /dev/null +++ b/typos.toml @@ -0,0 +1,4 @@ +[files] +# From my understanding, they are automatically generated +# Plus, systest hasn't been used in who knows how long +extend-exclude = ["tests/**"]