enable too_many_lines lint

And just disable it everywhere it fires, I know.
This commit is contained in:
Charles Hall 2024-05-14 19:17:47 -07:00
parent 8ef278d358
commit baab928281
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
19 changed files with 27 additions and 1 deletions

View file

@ -74,6 +74,7 @@ pub(crate) async fn get_register_available_route(
/// - If type is not guest and no username is given: Always fails after UIAA check
/// - Creates a new account and populates it with default account data
/// - If `inhibit_login` is false: Creates a device and returns `device_id` and `access_token`
#[allow(clippy::too_many_lines)]
pub(crate) async fn register_route(
body: Ruma<register::v3::Request>,
) -> Result<register::v3::Response> {

View file

@ -13,6 +13,7 @@ use tracing::error;
///
/// - Only works if the user is joined (TODO: always allow, but only show events if the user was
/// joined, depending on `history_visibility`)
#[allow(clippy::too_many_lines)]
pub(crate) async fn get_context_route(
body: Ruma<get_context::v3::Request>,
) -> Result<get_context::v3::Response> {

View file

@ -123,6 +123,7 @@ pub(crate) async fn get_room_visibility_route(
})
}
#[allow(clippy::too_many_lines)]
pub(crate) async fn get_public_rooms_filtered_helper(
server: Option<&ServerName>,
limit: Option<UInt>,

View file

@ -256,6 +256,7 @@ pub(crate) async fn get_key_changes_route(
})
}
#[allow(clippy::too_many_lines)]
pub(crate) async fn get_keys_helper<F: Fn(&UserId) -> bool>(
sender_user: Option<&UserId>,
device_keys_input: &BTreeMap<OwnedUserId, Vec<OwnedDeviceId>>,

View file

@ -518,6 +518,7 @@ pub(crate) async fn joined_members_route(
Ok(joined_members::v3::Response { joined })
}
#[allow(clippy::too_many_lines)]
async fn join_room_by_id_helper(
sender_user: Option<&UserId>,
room_id: &RoomId,
@ -1200,6 +1201,7 @@ async fn validate_and_add_event_id(
Ok((event_id, value))
}
#[allow(clippy::too_many_lines)]
pub(crate) async fn invite_helper(
sender_user: &UserId,
user_id: &UserId,

View file

@ -112,6 +112,7 @@ pub(crate) async fn send_message_event_route(
///
/// - Only works if the user is joined (TODO: always allow, but only show events where the user was
/// joined, depending on `history_visibility`)
#[allow(clippy::too_many_lines)]
pub(crate) async fn get_message_events_route(
body: Ruma<get_message_events::v3::Request>,
) -> Result<get_message_events::v3::Response> {

View file

@ -45,6 +45,7 @@ use tracing::{info, warn};
/// - Send events listed in initial state
/// - Send events implied by `name` and `topic`
/// - Send invite events
#[allow(clippy::too_many_lines)]
pub(crate) async fn create_room_route(
body: Ruma<create_room::v3::Request>,
) -> Result<create_room::v3::Response> {
@ -580,6 +581,7 @@ pub(crate) async fn get_room_aliases_route(
/// - Transfers some state events
/// - Moves local aliases
/// - Modifies old room power levels to prevent users from speaking
#[allow(clippy::too_many_lines)]
pub(crate) async fn upgrade_room_route(
body: Ruma<upgrade_room::v3::Request>,
) -> Result<upgrade_room::v3::Response> {

View file

@ -17,6 +17,7 @@ use std::collections::BTreeMap;
/// Searches rooms for messages.
///
/// - Only works if the user is currently joined to the room (TODO: Respect history visibility)
#[allow(clippy::too_many_lines)]
pub(crate) async fn search_events_route(
body: Ruma<search_events::v3::Request>,
) -> Result<search_events::v3::Response> {

View file

@ -47,6 +47,7 @@ pub(crate) async fn get_login_types_route(
///
/// Note: You can use [`GET /_matrix/client/r0/login`](fn.get_supported_versions_route.html) to see
/// supported login types.
#[allow(clippy::too_many_lines)]
pub(crate) async fn login_route(body: Ruma<login::v3::Request>) -> Result<login::v3::Response> {
// To allow deprecated login methods
#![allow(deprecated)]

View file

@ -168,6 +168,7 @@ async fn sync_helper_wrapper(
.expect("receiver should not be dropped");
}
#[allow(clippy::too_many_lines)]
async fn sync_helper(
sender_user: OwnedUserId,
sender_device: OwnedDeviceId,
@ -546,7 +547,7 @@ async fn sync_helper(
}
}
#[allow(clippy::too_many_arguments)]
#[allow(clippy::too_many_arguments, clippy::too_many_lines)]
async fn load_joined_room(
sender_user: &UserId,
sender_device: &DeviceId,
@ -1154,6 +1155,7 @@ fn share_encrypted_room(
.any(|encrypted| encrypted))
}
#[allow(clippy::too_many_lines)]
pub(crate) async fn sync_events_v4_route(
body: Ruma<sync_events::v4::Request>,
) -> Result<sync_events::v4::Response, RumaResponse<UiaaResponse>> {

View file

@ -40,6 +40,7 @@ where
{
type Rejection = Error;
#[allow(clippy::too_many_lines)]
async fn from_request(req: Request<B>, _state: &S) -> Result<Self, Self::Rejection> {
#[derive(Deserialize)]
struct QueryParams {

View file

@ -343,6 +343,7 @@ fn add_port_to_hostname(destination_str: &str) -> FedDest {
/// Returns: `actual_destination`, `Host` header
/// Implemented according to the specification at <https://matrix.org/docs/spec/server_server/r0.1.4#resolving-server-names>
/// Numbers in comments below refer to bullet points in linked section of specification
#[allow(clippy::too_many_lines)]
async fn find_actual_destination(destination: &'_ ServerName) -> (FedDest, FedDest) {
debug!("Finding actual destination for {destination}");
let destination_str = destination.as_str().to_owned();
@ -653,6 +654,7 @@ pub(crate) fn parse_incoming_pdu(
/// # `PUT /_matrix/federation/v1/send/{txnId}`
///
/// Push EDUs and PDUs to this server.
#[allow(clippy::too_many_lines)]
pub(crate) async fn send_transaction_message_route(
body: Ruma<send_transaction_message::v1::Request>,
) -> Result<send_transaction_message::v1::Response> {
@ -1432,6 +1434,7 @@ pub(crate) async fn create_join_event_template_route(
})
}
#[allow(clippy::too_many_lines)]
async fn create_join_event(
sender_servername: &ServerName,
room_id: &RoomId,