diff --git a/lib/federation/activity_pub/transmogrifier.ex b/lib/federation/activity_pub/transmogrifier.ex index ea050958..b2430899 100644 --- a/lib/federation/activity_pub/transmogrifier.ex +++ b/lib/federation/activity_pub/transmogrifier.ex @@ -317,9 +317,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do e -> Logger.warn( - "Unable to process Accept activity #{inspect(id)} for object #{inspect(accepted_object)} only returned #{ - inspect(e) - }" + "Unable to process Accept activity #{inspect(id)} for object #{inspect(accepted_object)} only returned #{inspect(e)}" ) :error @@ -347,9 +345,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do e -> Logger.warn( - "Unable to process Reject activity #{inspect(id)} for object #{inspect(rejected_object)} only returned #{ - inspect(e) - }" + "Unable to process Reject activity #{inspect(id)} for object #{inspect(rejected_object)} only returned #{inspect(e)}" ) :error @@ -734,9 +730,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do else {:is_admin, {:ok, %Member{}}} -> Logger.warn( - "Person #{inspect(actor)} is not an admin from #{inspect(origin)} and can't remove member #{ - inspect(object) - }" + "Person #{inspect(actor)} is not an admin from #{inspect(origin)} and can't remove member #{inspect(object)}" ) {:error, "Member already removed"} diff --git a/lib/federation/activity_pub/utils.ex b/lib/federation/activity_pub/utils.ex index 01ad1abc..fe5fd4f0 100644 --- a/lib/federation/activity_pub/utils.ex +++ b/lib/federation/activity_pub/utils.ex @@ -303,18 +303,14 @@ defmodule Mobilizon.Federation.ActivityPub.Utils do case role do :moderator -> Logger.debug( - "Checking if activity actor #{actor_url} is a moderator from group from #{ - object.url - }" + "Checking if activity actor #{actor_url} is a moderator from group from #{object.url}" ) Actors.is_moderator?(actor_id, group_id) :administrator -> Logger.debug( - "Checking if activity actor #{actor_url} is an administrator from group from #{ - object.url - }" + "Checking if activity actor #{actor_url} is an administrator from group from #{object.url}" ) Actors.is_administrator?(actor_id, group_id) diff --git a/lib/federation/activity_stream/converter/resource.ex b/lib/federation/activity_stream/converter/resource.ex index 0472ca1b..a0d8ca6e 100644 --- a/lib/federation/activity_stream/converter/resource.ex +++ b/lib/federation/activity_stream/converter/resource.ex @@ -104,9 +104,7 @@ defmodule Mobilizon.Federation.ActivityStream.Converter.Resource do @spec get_parent_id(String.t(), String.t()) :: Resource.t() | map() defp get_parent_id(context, resources_url) do Logger.debug( - "Getting parentID for context #{inspect(context)} and with resources_url #{ - inspect(resources_url) - }" + "Getting parentID for context #{inspect(context)} and with resources_url #{inspect(resources_url)}" ) case Utils.get_url(context) do diff --git a/lib/mix/tasks/mobilizon/instance.ex b/lib/mix/tasks/mobilizon/instance.ex index dcb4e552..af4d844b 100644 --- a/lib/mix/tasks/mobilizon/instance.ex +++ b/lib/mix/tasks/mobilizon/instance.ex @@ -170,9 +170,7 @@ defmodule Mix.Tasks.Mobilizon.Instance do """ To get started: 1. Check the contents of the generated files. - 2. Run `sudo -u postgres psql -f #{escape_sh_path(psql_path)} && rm #{ - escape_sh_path(psql_path) - }`. + 2. Run `sudo -u postgres psql -f #{escape_sh_path(psql_path)} && rm #{escape_sh_path(psql_path)}`. """ ) else diff --git a/lib/mix/tasks/mobilizon/users/clean.ex b/lib/mix/tasks/mobilizon/users/clean.ex index ff8fe764..04f6f22d 100644 --- a/lib/mix/tasks/mobilizon/users/clean.ex +++ b/lib/mix/tasks/mobilizon/users/clean.ex @@ -66,9 +66,7 @@ defmodule Mix.Tasks.Mobilizon.Users.Clean do Enum.each(deleted_users, fn deleted_user -> shell_info( - "ID: #{deleted_user.id}, Email: #{deleted_user.email}, Profile: @#{ - hd(deleted_user.actors).preferred_username - }" + "ID: #{deleted_user.id}, Email: #{deleted_user.email}, Profile: @#{hd(deleted_user.actors).preferred_username}" ) end) end diff --git a/lib/mix/tasks/mobilizon/users/modify.ex b/lib/mix/tasks/mobilizon/users/modify.ex index e49e8e1e..e36ad7a4 100644 --- a/lib/mix/tasks/mobilizon/users/modify.ex +++ b/lib/mix/tasks/mobilizon/users/modify.ex @@ -58,11 +58,9 @@ defmodule Mix.Tasks.Mobilizon.Users.Modify do An user has been modified with the following information: - email: #{user.email} - Role: #{user.role} - - account status: #{ - if user.confirmed_at, - do: "activated on #{DateTime.to_string(user.confirmed_at)} (UTC)", - else: "disabled" - } + - account status: #{if user.confirmed_at, + do: "activated on #{DateTime.to_string(user.confirmed_at)} (UTC)", + else: "disabled"} """) else {:makes_changes, false} -> diff --git a/lib/mix/tasks/mobilizon/users/show.ex b/lib/mix/tasks/mobilizon/users/show.ex index 6651eb98..60ed9acc 100644 --- a/lib/mix/tasks/mobilizon/users/show.ex +++ b/lib/mix/tasks/mobilizon/users/show.ex @@ -19,11 +19,9 @@ defmodule Mix.Tasks.Mobilizon.Users.Show do actors <- Users.get_actors_for_user(user) do shell_info(""" Informations for the user #{user.email}: - - account status: #{ - if user.confirmed_at, - do: "Activated on #{DateTime.to_string(user.confirmed_at)} (UTC)", - else: "disabled" - } + - account status: #{if user.confirmed_at, + do: "Activated on #{DateTime.to_string(user.confirmed_at)} (UTC)", + else: "disabled"} - Role: #{user.role} #{display_actors(actors)} """) diff --git a/lib/mobilizon/actors/actors.ex b/lib/mobilizon/actors/actors.ex index ad4e454e..2f78c3dc 100644 --- a/lib/mobilizon/actors/actors.ex +++ b/lib/mobilizon/actors/actors.ex @@ -1254,9 +1254,7 @@ defmodule Mobilizon.Actors do # Check if followed has blocked follower {:already_following, nil} <- {:already_following, is_following(follower, followed)} do Logger.info( - "Making #{Actor.preferred_username_and_domain(follower)} follow #{ - Actor.preferred_username_and_domain(followed) - } " <> + "Making #{Actor.preferred_username_and_domain(follower)} follow #{Actor.preferred_username_and_domain(followed)} " <> "(approved: #{approved})" ) @@ -1269,9 +1267,7 @@ defmodule Mobilizon.Actors do else {:already_following, %Follower{}} -> {:error, :already_following, - "Could not follow actor: you are already following #{ - Actor.preferred_username_and_domain(followed) - }"} + "Could not follow actor: you are already following #{Actor.preferred_username_and_domain(followed)}"} {:suspended, _} -> {:error, :suspended, diff --git a/lib/mobilizon/addresses/address.ex b/lib/mobilizon/addresses/address.ex index 7485ee7a..2df32175 100644 --- a/lib/mobilizon/addresses/address.ex +++ b/lib/mobilizon/addresses/address.ex @@ -85,9 +85,7 @@ defmodule Mobilizon.Addresses.Address do def representation(%__MODULE__{} = address) do String.trim( - "#{address.street} #{address.postal_code} #{address.locality} #{address.region} #{ - address.country - }" + "#{address.street} #{address.postal_code} #{address.locality} #{address.region} #{address.country}" ) end end diff --git a/lib/service/geospatial/map_quest.ex b/lib/service/geospatial/map_quest.ex index 77e7f653..155a53df 100644 --- a/lib/service/geospatial/map_quest.ex +++ b/lib/service/geospatial/map_quest.ex @@ -35,9 +35,7 @@ defmodule Mobilizon.Service.Geospatial.MapQuest do with {:ok, %{status: 200, body: body}} <- GeospatialClient.get( - "https://#{prefix}.mapquestapi.com/geocoding/v1/reverse?key=#{api_key}&location=#{ - lat - },#{lon}&maxResults=#{limit}" + "https://#{prefix}.mapquestapi.com/geocoding/v1/reverse?key=#{api_key}&location=#{lat},#{lon}&maxResults=#{limit}" ), %{"results" => results, "info" => %{"statuscode" => 0}} <- body do results |> Enum.map(&process_data/1) @@ -63,9 +61,7 @@ defmodule Mobilizon.Service.Geospatial.MapQuest do if is_nil(api_key), do: raise(ArgumentError, message: @api_key_missing_message) url = - "https://#{prefix}.mapquestapi.com/geocoding/v1/address?key=#{api_key}&location=#{ - URI.encode(q) - }&maxResults=#{limit}" + "https://#{prefix}.mapquestapi.com/geocoding/v1/address?key=#{api_key}&location=#{URI.encode(q)}&maxResults=#{limit}" Logger.debug("Asking MapQuest for addresses with #{url}") diff --git a/lib/service/geospatial/nominatim.ex b/lib/service/geospatial/nominatim.ex index 92ba1b3f..9b8754d5 100644 --- a/lib/service/geospatial/nominatim.ex +++ b/lib/service/geospatial/nominatim.ex @@ -42,14 +42,10 @@ defmodule Mobilizon.Service.Geospatial.Nominatim do url = case method do :search -> - "#{endpoint}/search?format=geocodejson&q=#{URI.encode(args.q)}&limit=#{limit}&accept-language=#{ - lang - }&addressdetails=1&namedetails=1" + "#{endpoint}/search?format=geocodejson&q=#{URI.encode(args.q)}&limit=#{limit}&accept-language=#{lang}&addressdetails=1&namedetails=1" :geocode -> - "#{endpoint}/reverse?format=geocodejson&lat=#{args.lat}&lon=#{args.lon}&accept-language=#{ - lang - }&addressdetails=1&namedetails=1" + "#{endpoint}/reverse?format=geocodejson&lat=#{args.lat}&lon=#{args.lon}&accept-language=#{lang}&addressdetails=1&namedetails=1" |> add_parameter(options, :zoom) end diff --git a/lib/service/notifications/scheduler.ex b/lib/service/notifications/scheduler.ex index 3a37e7e3..0f9356d6 100644 --- a/lib/service/notifications/scheduler.ex +++ b/lib/service/notifications/scheduler.ex @@ -93,9 +93,7 @@ defmodule Mobilizon.Service.Notifications.Scheduler do %DateTime{} = begins_on_shifted = shift_zone(begins_on, timezone) Logger.debug( - "Participation event start at #{inspect(begins_on_shifted)} (user timezone is #{ - timezone - })" + "Participation event start at #{inspect(begins_on_shifted)} (user timezone is #{timezone})" ) notification_date = diff --git a/priv/repo/migrations/20190929170817_rename_postgres_types.exs b/priv/repo/migrations/20190929170817_rename_postgres_types.exs index b418e679..ca2057a2 100644 --- a/priv/repo/migrations/20190929170817_rename_postgres_types.exs +++ b/priv/repo/migrations/20190929170817_rename_postgres_types.exs @@ -36,9 +36,7 @@ defmodule Mobilizon.Storage.Repo.Migrations.RenamePostgresTypes do with %Postgrex.Result{columns: ["exists"], rows: [[true]]} <- Ecto.Adapters.SQL.query!( Mobilizon.Storage.Repo, - "select exists (select 1 from pg_type where typname = '#{ - old_type_name |> remove_schema - }' and typnamespace = (select oid from pg_namespace where nspname = 'public'))" + "select exists (select 1 from pg_type where typname = '#{old_type_name |> remove_schema}' and typnamespace = (select oid from pg_namespace where nspname = 'public'))" ) do Ecto.Migration.execute( "ALTER TYPE #{old_type_name |> remove_schema} RENAME TO #{new_type_name |> remove_schema}" diff --git a/priv/repo/migrations/20210217164549_add_member_since_to_members.exs b/priv/repo/migrations/20210217164549_add_member_since_to_members.exs index d4eaaf11..87e1ff0a 100644 --- a/priv/repo/migrations/20210217164549_add_member_since_to_members.exs +++ b/priv/repo/migrations/20210217164549_add_member_since_to_members.exs @@ -18,9 +18,7 @@ defmodule Mobilizon.Storage.Repo.Migrations.AddMemberSinceToMembers do if role in ["member", "moderator", "administrator", "creator"] do Ecto.Adapters.SQL.query!( Mobilizon.Storage.Repo, - "UPDATE members SET member_since = '#{DateTime.to_iso8601(DateTime.utc_now())}' WHERE id = '#{ - Ecto.UUID.cast!(id) - }'" + "UPDATE members SET member_since = '#{DateTime.to_iso8601(DateTime.utc_now())}' WHERE id = '#{Ecto.UUID.cast!(id)}'" ) end end) diff --git a/test/graphql/resolvers/event_test.exs b/test/graphql/resolvers/event_test.exs index 94db0cd6..ec07b5bd 100644 --- a/test/graphql/resolvers/event_test.exs +++ b/test/graphql/resolvers/event_test.exs @@ -384,9 +384,7 @@ defmodule Mobilizon.Web.Resolvers.EventTest do createEvent( title: "my event is referenced", description: "with tags!", - begins_on: "#{ - DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601() - }", + begins_on: "#{DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601()}", organizer_actor_id: "#{actor.id}", category: "birthday", tags: ["nicolas", "birthday", "bad tag"] @@ -428,9 +426,7 @@ defmodule Mobilizon.Web.Resolvers.EventTest do createEvent( title: "my event is referenced", description: "with tags!", - begins_on: "#{ - DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601() - }", + begins_on: "#{DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601()}", organizer_actor_id: "#{actor.id}", category: "birthday", physical_address: { @@ -470,9 +466,7 @@ defmodule Mobilizon.Web.Resolvers.EventTest do createEvent( title: "my event is referenced", description: "with tags!", - begins_on: "#{ - DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601() - }", + begins_on: "#{DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601()}", organizer_actor_id: "#{actor.id}", category: "birthday", physical_address: { @@ -520,9 +514,7 @@ defmodule Mobilizon.Web.Resolvers.EventTest do createEvent( title: "come to my event", description: "it will be fine", - begins_on: "#{ - DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601() - }", + begins_on: "#{DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601()}", organizer_actor_id: "#{actor.id}", category: "birthday", picture: { @@ -609,9 +601,7 @@ defmodule Mobilizon.Web.Resolvers.EventTest do createEvent( title: "come to my event", description: "it will be fine", - begins_on: "#{ - DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601() - }", + begins_on: "#{DateTime.utc_now() |> DateTime.truncate(:second) |> DateTime.to_iso8601()}", organizer_actor_id: "#{actor.id}", category: "birthday", picture: { diff --git a/test/service/formatter/formatter_test.exs b/test/service/formatter/formatter_test.exs index 3dd7ba16..3a545135 100644 --- a/test/service/formatter/formatter_test.exs +++ b/test/service/formatter/formatter_test.exs @@ -130,11 +130,7 @@ defmodule Mobilizon.Service.FormatterTest do assert length(mentions) == 3 expected_text = - "@gsimg According to @archa_eme_, that is @daggsy. Also hello @archaeme" + "@gsimg According to @archa_eme_, that is @daggsy. Also hello @archaeme" assert expected_text == text end diff --git a/test/service/metadata/instance_test.exs b/test/service/metadata/instance_test.exs index 8e7033e8..e39c67e8 100644 --- a/test/service/metadata/instance_test.exs +++ b/test/service/metadata/instance_test.exs @@ -10,15 +10,7 @@ defmodule Mobilizon.Service.Metadata.InstanceTest do description = Utils.process_description(Config.instance_description()) assert Instance.build_tags() |> Utils.stringify_tags() == - "