CI: Bump lint stage to elixir-1.12
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Wed, 6 Oct 2021 06:08:21 +0000 (08:08 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Wed, 6 Oct 2021 06:11:05 +0000 (08:11 +0200)
Elixir 1.12 changed formatting rules, this allows to avoid having to rollback to run `mix format`

39 files changed:
.gitlab-ci.yml
lib/mix/tasks/pleroma/config.ex
lib/mix/tasks/pleroma/user.ex
lib/pleroma/bbs/handler.ex
lib/pleroma/config/oban.ex
lib/pleroma/config/transfer_task.ex
lib/pleroma/emoji/loader.ex
lib/pleroma/gun/conn.ex
lib/pleroma/moderation_log.ex
lib/pleroma/telemetry/logger.ex
lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/activity_pub/mrf.ex
lib/pleroma/web/activity_pub/mrf/steal_emoji_policy.ex
lib/pleroma/web/activity_pub/mrf/subchain_policy.ex
lib/pleroma/web/common_api.ex
lib/pleroma/web/mastodon_api/websocket_handler.ex
priv/repo/migrations/20171212164525_fill_recipients_in_activities.exs
priv/repo/migrations/20200428221338_insert_skeletons_for_deleted_users.exs
test/pleroma/emails/admin_email_test.exs
test/pleroma/formatter_test.exs
test/pleroma/moderation_log_test.exs
test/pleroma/user_test.exs
test/pleroma/web/admin_api/controllers/admin_api_controller_test.exs
test/pleroma/web/admin_api/controllers/report_controller_test.exs
test/pleroma/web/common_api/utils_test.exs
test/pleroma/web/common_api_test.exs
test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
test/pleroma/web/mastodon_api/controllers/notification_controller_test.exs
test/pleroma/web/mastodon_api/controllers/search_controller_test.exs
test/pleroma/web/mastodon_api/update_credentials_test.exs
test/pleroma/web/media_proxy/media_proxy_controller_test.exs
test/pleroma/web/pleroma_api/controllers/account_controller_test.exs
test/pleroma/web/rich_media/parser/ttl/aws_signed_url_test.exs
test/pleroma/web/twitter_api/twitter_api_test.exs
test/pleroma/web/twitter_api/util_controller_test.exs
test/pleroma/web/web_finger/web_finger_controller_test.exs
test/support/api_spec_helpers.ex
test/support/conn_case.ex
test/support/http_request_mock.ex

index 0f14b1aa10f8bac8d3aa7f494b14971a4f94b88d..9041443c5b6b46ae0140a2df19aaa9dc8ec8afce 100644 (file)
@@ -134,6 +134,7 @@ unit-testing-rum:
     - mix test --preload-modules
 
 lint:
+  image: elixir:1.12
   stage: test
   only:
     changes:
index 22502a522a332a0df28e55ec947ca559cfe0d3be..05ff8076fe34f94709d985e8515fa64e55527fae 100644 (file)
@@ -286,9 +286,7 @@ defmodule Mix.Tasks.Pleroma.Config do
         file = File.open!(tmp_config_path)
 
         shell_info(
-          "Saving database configuration settings to #{tmp_config_path}. Copy it to the #{
-            Path.dirname(config_path)
-          } manually."
+          "Saving database configuration settings to #{tmp_config_path}. Copy it to the #{Path.dirname(config_path)} manually."
         )
 
         write_config(file, tmp_config_path, opts)
index 53d5fc6d927799253ee85a98d66e14cbd7a4d610..e848222b8c352f8d70f6bf0438c44705f8a2d221 100644 (file)
@@ -51,9 +51,7 @@ defmodule Mix.Tasks.Pleroma.User do
     A user will be created with the following information:
       - nickname: #{nickname}
       - email: #{email}
-      - password: #{
-      if(generated_password?, do: "[generated; a reset link will be created]", else: password)
-    }
+      - password: #{if(generated_password?, do: "[generated; a reset link will be created]", else: password)}
       - name: #{name}
       - bio: #{bio}
       - moderator: #{if(moderator?, do: "true", else: "false")}
@@ -114,15 +112,9 @@ defmodule Mix.Tasks.Pleroma.User do
          {:ok, token} <- Pleroma.PasswordResetToken.create_token(user) do
       shell_info("Generated password reset token for #{user.nickname}")
 
-      IO.puts(
-        "URL: #{
-          Pleroma.Web.Router.Helpers.reset_password_url(
-            Pleroma.Web.Endpoint,
-            :reset,
-            token.token
-          )
-        }"
-      )
+      IO.puts("URL: #{Pleroma.Web.Router.Helpers.reset_password_url(Pleroma.Web.Endpoint,
+      :reset,
+      token.token)}")
     else
       _ ->
         shell_error("No local user #{nickname}")
@@ -321,9 +313,7 @@ defmodule Mix.Tasks.Pleroma.User do
         end
 
       shell_info(
-        "ID: #{invite.id} | Token: #{invite.token} | Token type: #{invite.invite_type} | Used: #{
-          invite.used
-        }#{expire_info}#{using_info}"
+        "ID: #{invite.id} | Token: #{invite.token} | Token type: #{invite.invite_type} | Used: #{invite.used}#{expire_info}#{using_info}"
       )
     end)
   end
@@ -424,9 +414,7 @@ defmodule Mix.Tasks.Pleroma.User do
       users
       |> Enum.each(fn user ->
         shell_info(
-          "#{user.nickname} moderator: #{user.is_moderator}, admin: #{user.is_admin}, locked: #{
-            user.is_locked
-          }, is_active: #{user.is_active}"
+          "#{user.nickname} moderator: #{user.is_moderator}, admin: #{user.is_admin}, locked: #{user.is_locked}, is_active: #{user.is_active}"
         )
       end)
     end)
index 4a2e255f762e575a96ef3f1e6942e0d46479f143..a38faa5b82371ebf03c6e18228ec4420cb6619db 100644 (file)
@@ -19,9 +19,7 @@ defmodule Pleroma.BBS.Handler do
   def on_connect(username, ip, port, method) do
     Logger.debug(fn ->
       """
-      Incoming SSH shell #{inspect(self())} requested for #{username} from #{inspect(ip)}:#{
-        inspect(port)
-      } using #{inspect(method)}
+      Incoming SSH shell #{inspect(self())} requested for #{username} from #{inspect(ip)}:#{inspect(port)} using #{inspect(method)}
       """
     end)
   end
index 3e63bca40e10594f49616ad52ec8998a77058b13..53ea7d7be316f90e62355007bef0cfeace1e91b3 100644 (file)
@@ -21,9 +21,7 @@ defmodule Pleroma.Config.Oban do
           """
           !!!OBAN CONFIG WARNING!!!
           You are using old workers in Oban crontab settings, which were removed.
-          Please, remove setting from crontab in your config file (prod.secret.exs): #{
-            inspect(setting)
-          }
+          Please, remove setting from crontab in your config file (prod.secret.exs): #{inspect(setting)}
           """
           |> Logger.warn()
 
index d5c6081a240834a03222bf336f43b42398348582..5371aae7a420c96bd857e1a7fe60a242e97e08d0 100644 (file)
@@ -148,9 +148,7 @@ defmodule Pleroma.Config.TransferTask do
     rescue
       error ->
         error_msg =
-          "updating env causes error, group: #{inspect(group)}, key: #{inspect(key)}, value: #{
-            inspect(value)
-          } error: #{inspect(error)}"
+          "updating env causes error, group: #{inspect(group)}, key: #{inspect(key)}, value: #{inspect(value)} error: #{inspect(error)}"
 
         Logger.warn(error_msg)
 
index 67acd7069ac6f10fa75691ea55e6c89bf03d2e49..95937a892bf567400a3d0a76a167b9c063b64fc9 100644 (file)
@@ -60,9 +60,7 @@ defmodule Pleroma.Emoji.Loader do
 
           if not Enum.empty?(files) do
             Logger.warn(
-              "Found files in the emoji folder. These will be ignored, please move them to a subdirectory\nFound files: #{
-                Enum.join(files, ", ")
-              }"
+              "Found files in the emoji folder. These will be ignored, please move them to a subdirectory\nFound files: #{Enum.join(files, ", ")}"
             )
           end
 
@@ -122,9 +120,7 @@ defmodule Pleroma.Emoji.Loader do
         extensions = Config.get([:emoji, :pack_extensions])
 
         Logger.info(
-          "No emoji.txt found for pack \"#{pack_name}\", assuming all #{
-            Enum.join(extensions, ", ")
-          } files are emoji"
+          "No emoji.txt found for pack \"#{pack_name}\", assuming all #{Enum.join(extensions, ", ")} files are emoji"
         )
 
         make_shortcode_to_file_map(pack_dir, extensions)
index a56625699325cda6f9bf2a65721dfe3a256f9a66..a1210eabf7cb688597751380511519e4ed4360e6 100644 (file)
@@ -57,9 +57,7 @@ defmodule Pleroma.Gun.Conn do
     else
       error ->
         Logger.warn(
-          "Opening proxied connection to #{compose_uri_log(uri)} failed with error #{
-            inspect(error)
-          }"
+          "Opening proxied connection to #{compose_uri_log(uri)} failed with error #{inspect(error)}"
         )
 
         error
@@ -93,9 +91,7 @@ defmodule Pleroma.Gun.Conn do
     else
       error ->
         Logger.warn(
-          "Opening socks proxied connection to #{compose_uri_log(uri)} failed with error #{
-            inspect(error)
-          }"
+          "Opening socks proxied connection to #{compose_uri_log(uri)} failed with error #{inspect(error)}"
         )
 
         error
index 1849cacc8889d7396345f3a7cf290de26c737fc7..993cff09b26cf3c9c6f819a16c1ee74d2fab2c90 100644 (file)
@@ -481,9 +481,7 @@ defmodule Pleroma.ModerationLog do
           "visibility" => visibility
         }
       }) do
-    "@#{actor_nickname} updated status ##{subject_id}, set sensitive: '#{sensitive}', visibility: '#{
-      visibility
-    }'"
+    "@#{actor_nickname} updated status ##{subject_id}, set sensitive: '#{sensitive}', visibility: '#{visibility}'"
   end
 
   def get_log_entry_message(%ModerationLog{
@@ -523,9 +521,7 @@ defmodule Pleroma.ModerationLog do
           "subject" => subjects
         }
       }) do
-    "@#{actor_nickname} re-sent confirmation email for users: #{
-      users_to_nicknames_string(subjects)
-    }"
+    "@#{actor_nickname} re-sent confirmation email for users: #{users_to_nicknames_string(subjects)}"
   end
 
   def get_log_entry_message(%ModerationLog{
index 44d2f48dcfb4b2500524d5b6bf18d72546a771ef..10165c1b221f9a84f8c6690e756da5fef13d2f6b 100644 (file)
@@ -29,9 +29,7 @@ defmodule Pleroma.Telemetry.Logger do
         _
       ) do
     Logger.debug(fn ->
-      "Connection pool is exhausted (reached #{max_connections} connections). Starting idle connection cleanup to reclaim as much as #{
-        reclaim_max
-      } connections"
+      "Connection pool is exhausted (reached #{max_connections} connections). Starting idle connection cleanup to reclaim as much as #{reclaim_max} connections"
     end)
   end
 
@@ -73,9 +71,7 @@ defmodule Pleroma.Telemetry.Logger do
         _
       ) do
     Logger.warn(fn ->
-      "Pool worker for #{key}: Client #{inspect(client_pid)} died before releasing the connection with #{
-        inspect(reason)
-      }"
+      "Pool worker for #{key}: Client #{inspect(client_pid)} died before releasing the connection with #{inspect(reason)}"
     end)
   end
 
index 19961a4a55ea5b9370922d1df63ca0b9330fe00a..dbaf06e7a34c3f843a8fa9fa3d86ad4fb35c49ba 100644 (file)
@@ -1597,9 +1597,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
          %User{} = old_user <- User.get_by_nickname(nickname),
          {_, false} <- {:ap_id_comparison, data[:ap_id] == old_user.ap_id} do
       Logger.info(
-        "Found an old user for #{nickname}, the old ap id is #{old_user.ap_id}, new one is #{
-          data[:ap_id]
-        }, renaming."
+        "Found an old user for #{nickname}, the old ap id is #{old_user.ap_id}, new one is #{data[:ap_id]}, renaming."
       )
 
       old_user
index e4ee8fe827fae7fdf827a517cb247fa708c1e054..bd6f6777f3aabacbfc30ad303320b38b8da1e5c0 100644 (file)
@@ -157,9 +157,7 @@ defmodule Pleroma.Web.ActivityPub.MRF do
           [description | acc]
         else
           Logger.warn(
-            "#{policy} config description doesn't have one or all required keys #{
-              inspect(@required_description_keys)
-            }"
+            "#{policy} config description doesn't have one or all required keys #{inspect(@required_description_keys)}"
           )
 
           acc
index fbe9795acf1bbf1b9237b858dc0de9ad1d5519e6..0dd415732fa7d7d6623d00be156bb22c83f2271a 100644 (file)
@@ -38,9 +38,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.StealEmojiPolicy do
         end
       else
         Logger.debug(
-          "MRF.StealEmojiPolicy: :#{shortcode}: at #{url} (#{byte_size(response.body)} B) over size limit (#{
-            size_limit
-          } B)"
+          "MRF.StealEmojiPolicy: :#{shortcode}: at #{url} (#{byte_size(response.body)} B) over size limit (#{size_limit} B)"
         )
 
         nil
index f84d7cc7169a6ba1b27a1becb31a1a80ba7b04ae..11a36aca1e31212660c9858d43f6a7ea909ea990 100644 (file)
@@ -23,9 +23,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.SubchainPolicy do
   def filter(%{"actor" => actor} = message) do
     with {:ok, match, subchain} <- lookup_subchain(actor) do
       Logger.debug(
-        "[SubchainPolicy] Matched #{actor} against #{inspect(match)} with subchain #{
-          inspect(subchain)
-        }"
+        "[SubchainPolicy] Matched #{actor} against #{inspect(match)} with subchain #{inspect(subchain)}"
       )
 
       MRF.filter(subchain, message)
index 1b5f8491efa0ddff51ce3d7769f50ec208df3a5a..6f685cb7ba570b117d768f34f79a1d1be8441e6c 100644 (file)
@@ -487,9 +487,7 @@ defmodule Pleroma.Web.CommonAPI do
     else
       {what, result} = error ->
         Logger.warn(
-          "CommonAPI.remove_mute/2 failed. #{what}: #{result}, user_id: #{user_id}, activity_id: #{
-            activity_id
-          }"
+          "CommonAPI.remove_mute/2 failed. #{what}: #{result}, user_id: #{user_id}, activity_id: #{activity_id}"
         )
 
         {:error, error}
index 0d1faffbd57f1ad78433205796ae31578f419d50..b978167b6288f95b3e8b042fb0b9625c2429e37f 100644 (file)
@@ -49,9 +49,7 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
 
   def websocket_init(state) do
     Logger.debug(
-      "#{__MODULE__} accepted websocket connection for user #{
-        (state.user || %{id: "anonymous"}).id
-      }, topic #{state.topic}"
+      "#{__MODULE__} accepted websocket connection for user #{(state.user || %{id: "anonymous"}).id}, topic #{state.topic}"
     )
 
     Streamer.add_socket(state.topic, state.user)
@@ -106,9 +104,7 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
 
   def terminate(reason, _req, state) do
     Logger.debug(
-      "#{__MODULE__} terminating websocket connection for user #{
-        (state.user || %{id: "anonymous"}).id
-      }, topic #{state.topic || "?"}: #{inspect(reason)}"
+      "#{__MODULE__} terminating websocket connection for user #{(state.user || %{id: "anonymous"}).id}, topic #{state.topic || "?"}: #{inspect(reason)}"
     )
 
     Streamer.remove_socket(state.topic)
index 6dfa9371682c2f7fff72414a67f50d26bd4ff91d..77a09781c4aef1eaeb53c95a6e63dd6c2ba213fd 100644 (file)
@@ -14,9 +14,7 @@ defmodule Pleroma.Repo.Migrations.FillRecipientsInActivities do
         max = min + 10_000
 
         execute("""
-        update activities set recipients = array(select jsonb_array_elements_text(data->'to')) where id > #{
-          min
-        } and id <= #{max};
+        update activities set recipients = array(select jsonb_array_elements_text(data->'to')) where id > #{min} and id <= #{max};
         """)
         |> IO.inspect()
       end)
index 2adc38186f9496a86ed6dfd59c43f161ffec0439..81f94119830d36552c83fb2fb4166308688ab925 100644 (file)
@@ -28,9 +28,7 @@ defmodule Pleroma.Repo.Migrations.InsertSkeletonsForDeletedUsers do
       {:ok, %{rows: ap_ids}} =
         Ecto.Adapters.SQL.query(
           Repo,
-          "select distinct unnest(nonexistent_locals.recipients) from activities, lateral (select array_agg(recipient) as recipients from unnest(activities.recipients) as recipient where recipient similar to '#{
-            instance_uri
-          }/users/[A-Za-z0-9]*' and not(recipient in (select ap_id from users))) nonexistent_locals;",
+          "select distinct unnest(nonexistent_locals.recipients) from activities, lateral (select array_agg(recipient) as recipients from unnest(activities.recipients) as recipient where recipient similar to '#{instance_uri}/users/[A-Za-z0-9]*' and not(recipient in (select ap_id from users))) nonexistent_locals;",
           [],
           timeout: :infinity
         )
index 04c907697452f469715dd997d9a773e77f6e09fd..e65752c235ffe2c58e2601231c4d9927b1b0beda 100644 (file)
@@ -27,11 +27,7 @@ defmodule Pleroma.Emails.AdminEmailTest do
     assert res.subject == "#{config[:name]} Report"
 
     assert res.html_body ==
-             "<p>Reported by: <a href=\"#{reporter_url}\">#{reporter.nickname}</a></p>\n<p>Reported Account: <a href=\"#{
-               account_url
-             }\">#{account.nickname}</a></p>\n<p>Comment: Test comment\n<p> Statuses:\n  <ul>\n    <li><a href=\"#{
-               status_url
-             }\">#{status_url}</li>\n  </ul>\n</p>\n\n<p>\n<a href=\"http://localhost:4001/pleroma/admin/#/reports/index\">View Reports in AdminFE</a>\n"
+             "<p>Reported by: <a href=\"#{reporter_url}\">#{reporter.nickname}</a></p>\n<p>Reported Account: <a href=\"#{account_url}\">#{account.nickname}</a></p>\n<p>Comment: Test comment\n<p> Statuses:\n  <ul>\n    <li><a href=\"#{status_url}\">#{status_url}</li>\n  </ul>\n</p>\n\n<p>\n<a href=\"http://localhost:4001/pleroma/admin/#/reports/index\">View Reports in AdminFE</a>\n"
   end
 
   test "it works when the reporter is a remote user without email" do
index 7f54638fbe743785496a0935fd9820c2f18ed043..b0f9f41b1207389825cf1cfc18dfbc249c51d5c2 100644 (file)
@@ -151,13 +151,7 @@ defmodule Pleroma.FormatterTest do
       assert length(mentions) == 3
 
       expected_text =
-        ~s(<span class="h-card"><a class="u-url mention" data-user="#{gsimg.id}" href="#{
-          gsimg.ap_id
-        }" rel="ugc">@<span>gsimg</span></a></span> According to <span class="h-card"><a class="u-url mention" data-user="#{
-          archaeme.id
-        }" href="#{"https://archeme/@archa_eme_"}" rel="ugc">@<span>archa_eme_</span></a></span>, that is @daggsy. Also hello <span class="h-card"><a class="u-url mention" data-user="#{
-          archaeme_remote.id
-        }" href="#{archaeme_remote.ap_id}" rel="ugc">@<span>archaeme</span></a></span>)
+        ~s(<span class="h-card"><a class="u-url mention" data-user="#{gsimg.id}" href="#{gsimg.ap_id}" rel="ugc">@<span>gsimg</span></a></span> According to <span class="h-card"><a class="u-url mention" data-user="#{archaeme.id}" href="#{"https://archeme/@archa_eme_"}" rel="ugc">@<span>archa_eme_</span></a></span>, that is @daggsy. Also hello <span class="h-card"><a class="u-url mention" data-user="#{archaeme_remote.id}" href="#{archaeme_remote.ap_id}" rel="ugc">@<span>archaeme</span></a></span>)
 
       assert expected_text == text
     end
@@ -172,9 +166,7 @@ defmodule Pleroma.FormatterTest do
       assert length(mentions) == 1
 
       expected_text =
-        ~s(<span class="h-card"><a class="u-url mention" data-user="#{mike.id}" href="#{
-          mike.ap_id
-        }" rel="ugc">@<span>mike</span></a></span> test)
+        ~s(<span class="h-card"><a class="u-url mention" data-user="#{mike.id}" href="#{mike.ap_id}" rel="ugc">@<span>mike</span></a></span> test)
 
       assert expected_text == text
     end
@@ -210,13 +202,7 @@ defmodule Pleroma.FormatterTest do
       assert mentions == [{"@#{user.nickname}", user}, {"@#{other_user.nickname}", other_user}]
 
       assert expected_text ==
-               ~s(<span class="h-card"><a class="u-url mention" data-user="#{user.id}" href="#{
-                 user.ap_id
-               }" rel="ugc">@<span>#{user.nickname}</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{
-                 other_user.id
-               }" href="#{other_user.ap_id}" rel="ugc">@<span>#{other_user.nickname}</span></a></span> hey dudes i hate <span class="h-card"><a class="u-url mention" data-user="#{
-                 third_user.id
-               }" href="#{third_user.ap_id}" rel="ugc">@<span>#{third_user.nickname}</span></a></span>)
+               ~s(<span class="h-card"><a class="u-url mention" data-user="#{user.id}" href="#{user.ap_id}" rel="ugc">@<span>#{user.nickname}</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{other_user.id}" href="#{other_user.ap_id}" rel="ugc">@<span>#{other_user.nickname}</span></a></span> hey dudes i hate <span class="h-card"><a class="u-url mention" data-user="#{third_user.id}" href="#{third_user.ap_id}" rel="ugc">@<span>#{third_user.nickname}</span></a></span>)
     end
 
     test "given the 'safe_mention' option, it will still work without any mention" do
index c6c170c45a9d6eaf0d84be3195d28176c6dc3ad5..607301815898f4b53cb82769157982e061803ba4 100644 (file)
@@ -236,9 +236,7 @@ defmodule Pleroma.ModerationLogTest do
       log = Repo.get(ModerationLog, log2.id)
 
       assert log.data["message"] ==
-               "@#{moderator.nickname} added note 'look at this' to report ##{report.id} on user @#{
-                 user.nickname
-               }"
+               "@#{moderator.nickname} added note 'look at this' to report ##{report.id} on user @#{user.nickname}"
     end
 
     test "logging status sensitivity update", %{moderator: moderator} do
index d19fee45d64572c53bb4b69ebbd4f7406f74534b..5fef81245b0af61959f4060cf2c124ab4ab70eb0 100644 (file)
@@ -1886,9 +1886,7 @@ defmodule Pleroma.UserTest do
       bio = "A.k.a. @nick@domain.com"
 
       expected_text =
-        ~s(A.k.a. <span class="h-card"><a class="u-url mention" data-user="#{remote_user.id}" href="#{
-          remote_user.ap_id
-        }" rel="ugc">@<span>nick@domain.com</span></a></span>)
+        ~s(A.k.a. <span class="h-card"><a class="u-url mention" data-user="#{remote_user.id}" href="#{remote_user.ap_id}" rel="ugc">@<span>nick@domain.com</span></a></span>)
 
       assert expected_text == User.parse_bio(bio, user)
     end
index 8cd9f939b20312ca64553e47a1b39c78b9ba63c3..262f93ec45a01f4b4dffc516306b2506a74eb39e 100644 (file)
@@ -267,9 +267,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
       log_entry = Repo.one(ModerationLog)
 
       assert ModerationLog.get_log_entry_message(log_entry) ==
-               "@#{admin.nickname} revoked admin role from @#{user_one.nickname}, @#{
-                 user_two.nickname
-               }"
+               "@#{admin.nickname} revoked admin role from @#{user_one.nickname}, @#{user_two.nickname}"
     end
   end
 
@@ -860,9 +858,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
       log_entry = Repo.one(ModerationLog)
 
       assert ModerationLog.get_log_entry_message(log_entry) ==
-               "@#{admin.nickname} confirmed email for users: @#{first_user.nickname}, @#{
-                 second_user.nickname
-               }"
+               "@#{admin.nickname} confirmed email for users: @#{first_user.nickname}, @#{second_user.nickname}"
     end
   end
 
@@ -883,9 +879,7 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do
       log_entry = Repo.one(ModerationLog)
 
       assert ModerationLog.get_log_entry_message(log_entry) ==
-               "@#{admin.nickname} re-sent confirmation email for users: @#{first_user.nickname}, @#{
-                 second_user.nickname
-               }"
+               "@#{admin.nickname} re-sent confirmation email for users: @#{first_user.nickname}, @#{second_user.nickname}"
 
       ObanHelpers.perform_all()
 
index 8102845d57a8ee61d038016c2f251bdafb3182dc..99cc7bbd0505cbfbaef312826e88e841e12db427 100644 (file)
@@ -204,9 +204,7 @@ defmodule Pleroma.Web.AdminAPI.ReportControllerTest do
                "@#{admin.nickname} updated report ##{id} (on user @#{activity.user_actor.nickname}) with 'resolved' state"
 
       assert ModerationLog.get_log_entry_message(second_log_entry) ==
-               "@#{admin.nickname} updated report ##{second_report_id} (on user @#{
-                 second_activity.user_actor.nickname
-               }) with 'closed' state"
+               "@#{admin.nickname} updated report ##{second_report_id} (on user @#{second_activity.user_actor.nickname}) with 'closed' state"
     end
   end
 
index d8fec35208bd47d41703a66a3e39f35936ccc0ff..fc01f820acd50fc1a3ae32cb379830b20a3a7585 100644 (file)
@@ -160,11 +160,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
       {output, _, _} = Utils.format_input(text, "text/markdown")
 
       assert output ==
-               ~s(<p><strong>hello world</strong></p><p><em>another <span class="h-card"><a class="u-url mention" data-user="#{
-                 user.id
-               }" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> and <span class="h-card"><a class="u-url mention" data-user="#{
-                 user.id
-               }" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> <a href="http://google.com" rel="ugc">google.com</a> paragraph</em></p>)
+               ~s(<p><strong>hello world</strong></p><p><em>another <span class="h-card"><a class="u-url mention" data-user="#{user.id}" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> and <span class="h-card"><a class="u-url mention" data-user="#{user.id}" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> <a href="http://google.com" rel="ugc">google.com</a> paragraph</em></p>)
     end
   end
 
@@ -201,11 +197,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
       {result, _, []} = Utils.format_input(code, "text/markdown")
 
       assert result ==
-               ~s[<p><span class="h-card"><a class="u-url mention" data-user="#{mario.id}" href="#{
-                 mario.ap_id
-               }" rel="ugc">@<span>mario</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{
-                 luigi.id
-               }" href="#{luigi.ap_id}" rel="ugc">@<span>luigi</span></a></span> yo what’s up?</p>]
+               ~s[<p><span class="h-card"><a class="u-url mention" data-user="#{mario.id}" href="#{mario.ap_id}" rel="ugc">@<span>mario</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{luigi.id}" href="#{luigi.ap_id}" rel="ugc">@<span>luigi</span></a></span> yo what’s up?</p>]
     end
 
     test "remote mentions" do
@@ -216,11 +208,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
       {result, _, []} = Utils.format_input(code, "text/markdown")
 
       assert result ==
-               ~s[<p><span class="h-card"><a class="u-url mention" data-user="#{mario.id}" href="#{
-                 mario.ap_id
-               }" rel="ugc">@<span>mario</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{
-                 luigi.id
-               }" href="#{luigi.ap_id}" rel="ugc">@<span>luigi</span></a></span> yo what’s up?</p>]
+               ~s[<p><span class="h-card"><a class="u-url mention" data-user="#{mario.id}" href="#{mario.ap_id}" rel="ugc">@<span>mario</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{luigi.id}" href="#{luigi.ap_id}" rel="ugc">@<span>luigi</span></a></span> yo what’s up?</p>]
     end
 
     test "raw HTML" do
index 4a10a5bc488e651ffbe2b1deb683f5fb9e62a02d..ad0b8754313cd399bb4b263ab9bafef9d8130448 100644 (file)
@@ -209,9 +209,7 @@ defmodule Pleroma.Web.CommonAPITest do
       object = Object.normalize(activity, fetch: false)
 
       assert object.data["content"] ==
-               "<a href=\"https://example.org\" rel=\"ugc\">https://example.org</a> is the site of <span class=\"h-card\"><a class=\"u-url mention\" data-user=\"#{
-                 other_user.id
-               }\" href=\"#{other_user.ap_id}\" rel=\"ugc\">@<span>#{other_user.nickname}</span></a></span> <a class=\"hashtag\" data-tag=\"2hu\" href=\"http://localhost:4001/tag/2hu\">#2hu</a>"
+               "<a href=\"https://example.org\" rel=\"ugc\">https://example.org</a> is the site of <span class=\"h-card\"><a class=\"u-url mention\" data-user=\"#{other_user.id}\" href=\"#{other_user.ap_id}\" rel=\"ugc\">@<span>#{other_user.nickname}</span></a></span> <a class=\"hashtag\" data-tag=\"2hu\" href=\"http://localhost:4001/tag/2hu\">#2hu</a>"
     end
 
     test "it posts a chat message" do
index 3036e25b3d633bce7f4283dfd3fec35f1a3d5a32..a92a582247ddf252eb83e6c61c9722107f6c870d 100644 (file)
@@ -709,9 +709,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
       assert [%{"id" => ^follower2_id}, %{"id" => ^follower1_id}] =
                conn
                |> get(
-                 "/api/v1/accounts/#{user.id}/followers?id=#{user.id}&limit=20&max_id=#{
-                   follower3_id
-                 }"
+                 "/api/v1/accounts/#{user.id}/followers?id=#{user.id}&limit=20&max_id=#{follower3_id}"
                )
                |> json_response_and_validate_schema(200)
 
index 2615912a8dac5fe06ca50ea0cbd1d4e19a78a7f0..14bb7dae55f898c0b51c90b8f69e33b25a1dd608 100644 (file)
@@ -44,9 +44,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
       |> get("/api/v1/notifications")
 
     expected_response =
-      "hi <span class=\"h-card\"><a class=\"u-url mention\" data-user=\"#{user.id}\" href=\"#{
-        user.ap_id
-      }\" rel=\"ugc\">@<span>#{user.nickname}</span></a></span>"
+      "hi <span class=\"h-card\"><a class=\"u-url mention\" data-user=\"#{user.id}\" href=\"#{user.ap_id}\" rel=\"ugc\">@<span>#{user.nickname}</span></a></span>"
 
     assert [%{"status" => %{"content" => response}} | _rest] =
              json_response_and_validate_schema(conn, 200)
@@ -114,9 +112,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
     conn = get(conn, "/api/v1/notifications/#{notification.id}")
 
     expected_response =
-      "hi <span class=\"h-card\"><a class=\"u-url mention\" data-user=\"#{user.id}\" href=\"#{
-        user.ap_id
-      }\" rel=\"ugc\">@<span>#{user.nickname}</span></a></span>"
+      "hi <span class=\"h-card\"><a class=\"u-url mention\" data-user=\"#{user.id}\" href=\"#{user.ap_id}\" rel=\"ugc\">@<span>#{user.nickname}</span></a></span>"
 
     assert %{"status" => %{"content" => response}} = json_response_and_validate_schema(conn, 200)
     assert response == expected_response
index 7b0bbd8bd6779ba640fe6ede11fbf145a9bfb726..e31cd0291fd0e264a8338ded17f77fc0b8dc60bd 100644 (file)
@@ -125,13 +125,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
       results =
         conn
         |> get(
-          "/api/v2/search?#{
-            URI.encode_query(%{
-              q:
-                "https://www.washingtonpost.com/sports/2020/06/10/" <>
-                  "nascar-ban-display-confederate-flag-all-events-properties/"
-            })
-          }"
+          "/api/v2/search?#{URI.encode_query(%{q: "https://www.washingtonpost.com/sports/2020/06/10/" <> "nascar-ban-display-confederate-flag-all-events-properties/"})}"
         )
         |> json_response_and_validate_schema(200)
 
@@ -156,9 +150,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do
       results =
         conn
         |> get(
-          "/api/v2/search?#{
-            URI.encode_query(%{q: "#some #text #with #hashtags", limit: 2, offset: 1})
-          }"
+          "/api/v2/search?#{URI.encode_query(%{q: "#some #text #with #hashtags", limit: 2, offset: 1})}"
         )
         |> json_response_and_validate_schema(200)
 
index cf8ccf18781186af63704843dafeeeb2912a17df..1d20278998923323feec3335e0c7e95722b4b870 100644 (file)
@@ -88,9 +88,7 @@ defmodule Pleroma.Web.MastodonAPI.UpdateCredentialsTest do
       assert user_data = json_response_and_validate_schema(conn, 200)
 
       assert user_data["note"] ==
-               ~s(I drink <a class="hashtag" data-tag="cofe" href="http://localhost:4001/tag/cofe">#cofe</a> with <span class="h-card"><a class="u-url mention" data-user="#{
-                 user2.id
-               }" href="#{user2.ap_id}" rel="ugc">@<span>#{user2.nickname}</span></a></span><br/><br/>suya..)
+               ~s(I drink <a class="hashtag" data-tag="cofe" href="http://localhost:4001/tag/cofe">#cofe</a> with <span class="h-card"><a class="u-url mention" data-user="#{user2.id}" href="#{user2.ap_id}" rel="ugc">@<span>#{user2.nickname}</span></a></span><br/><br/>suya..)
 
       assert user_data["source"]["note"] == raw_bio
 
index 2a449e56d9553bcad2d10c89bd8c6d0180d3f163..1f2e5419446fba81c870b5e9af7b8f9fd4aaeca7 100644 (file)
@@ -81,9 +81,7 @@ defmodule Pleroma.Web.MediaProxy.MediaProxyControllerTest do
       missing_dependencies = Pleroma.Helpers.MediaHelper.missing_dependencies()
 
       assert missing_dependencies == [],
-             "Error: missing dependencies (please refer to `docs/installation`): #{
-               inspect(missing_dependencies)
-             }"
+             "Error: missing dependencies (please refer to `docs/installation`): #{inspect(missing_dependencies)}"
     end
 
     setup do
index 9f14c55770b38c3d54a6919f047848051fe48bef..ad271c31b1f3be4c2a98e91b9c58e48fee375409 100644 (file)
@@ -174,9 +174,7 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do
       response =
         conn
         |> get(
-          "/api/v1/pleroma/accounts/#{user.id}/favourites?since_id=#{third_activity.id}&max_id=#{
-            seventh_activity.id
-          }"
+          "/api/v1/pleroma/accounts/#{user.id}/favourites?since_id=#{third_activity.id}&max_id=#{seventh_activity.id}"
         )
         |> json_response_and_validate_schema(:ok)
 
index df3ea3e998e652b97a947d0c5ac526c2bbcc6eb8..0c82034176f0a01175bba4515f0eb3d8c381db87 100644 (file)
@@ -66,9 +66,7 @@ defmodule Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrlTest do
   end
 
   defp construct_s3_url(timestamp, valid_till) do
-    "https://pleroma.s3.ap-southeast-1.amazonaws.com/sachin%20%281%29%20_a%20-%25%2Aasdasd%20BNN%20bnnn%20.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIBLWWK6RGDQXDLJQ%2F20190716%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=#{
-      timestamp
-    }&X-Amz-Expires=#{valid_till}&X-Amz-Signature=04ffd6b98634f4b1bbabc62e0fac4879093cd54a6eed24fe8eb38e8369526bbf&X-Amz-SignedHeaders=host"
+    "https://pleroma.s3.ap-southeast-1.amazonaws.com/sachin%20%281%29%20_a%20-%25%2Aasdasd%20BNN%20bnnn%20.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIBLWWK6RGDQXDLJQ%2F20190716%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=#{timestamp}&X-Amz-Expires=#{valid_till}&X-Amz-Signature=04ffd6b98634f4b1bbabc62e0fac4879093cd54a6eed24fe8eb38e8369526bbf&X-Amz-SignedHeaders=host"
   end
 
   defp construct_metadata(timestamp, valid_till, url) do
index 85629be04c4c31b53737da00e3fa235ac00be099..2b8a4c3f5cbe2cf273878a1bbf1791484b9bed4c 100644 (file)
@@ -139,9 +139,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
     {:ok, user2} = TwitterAPI.register_user(data2)
 
     expected_text =
-      ~s(<span class="h-card"><a class="u-url mention" data-user="#{user1.id}" href="#{
-        user1.ap_id
-      }" rel="ugc">@<span>john</span></a></span> test)
+      ~s(<span class="h-card"><a class="u-url mention" data-user="#{user1.id}" href="#{user1.ap_id}" rel="ugc">@<span>john</span></a></span> test)
 
     assert user2.bio == expected_text
   end
index 67bd4b27f4531f9d43dae6087b73e15b0e5ecc05..3380aec2234df8dc87d787d94f8ee0dc9d8ee8d0 100644 (file)
@@ -26,11 +26,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
     test "it updates notification settings", %{user: user, conn: conn} do
       conn
       |> put(
-        "/api/pleroma/notification_settings?#{
-          URI.encode_query(%{
-            block_from_strangers: true
-          })
-        }"
+        "/api/pleroma/notification_settings?#{URI.encode_query(%{block_from_strangers: true})}"
       )
       |> json_response_and_validate_schema(:ok)
 
@@ -45,11 +41,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilControllerTest do
     test "it updates notification settings to enable hiding contents", %{user: user, conn: conn} do
       conn
       |> put(
-        "/api/pleroma/notification_settings?#{
-          URI.encode_query(%{
-            hide_notification_contents: 1
-          })
-        }"
+        "/api/pleroma/notification_settings?#{URI.encode_query(%{hide_notification_contents: 1})}"
       )
       |> json_response_and_validate_schema(:ok)
 
index 2421c5800a82487db8d3120e5ea8707da2e0524a..66d79320f7b7973bb25a2cc41f212e5ea94f1f7f 100644 (file)
@@ -24,9 +24,7 @@ defmodule Pleroma.Web.WebFinger.WebFingerControllerTest do
     assert response.status == 200
 
     assert response.resp_body ==
-             ~s(<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" template="#{
-               Pleroma.Web.Endpoint.url()
-             }/.well-known/webfinger?resource={uri}" type="application/xrd+xml" /></XRD>)
+             ~s(<?xml version="1.0" encoding="UTF-8"?><XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0"><Link rel="lrdd" template="#{Pleroma.Web.Endpoint.url()}/.well-known/webfinger?resource={uri}" type="application/xrd+xml" /></XRD>)
   end
 
   test "Webfinger JRD" do
index 36d6a8b81c246973b3cb62b012acc163b29bbfd8..886e72d73026387d3f86827cf141119dd239d6dd 100644 (file)
@@ -29,9 +29,7 @@ defmodule Pleroma.Tests.ApiSpecHelpers do
           end)
 
         flunk(
-          "Value does not conform to schema #{schema.title}: #{Enum.join(errors, "\n")}\n#{
-            inspect(value)
-          }"
+          "Value does not conform to schema #{schema.title}: #{Enum.join(errors, "\n")}\n#{inspect(value)}"
         )
     end
   end
index deee9859976e681b0feceb4ffc824b4cb72592a4..eab46983391fb17415dbd82cfe1140f25541416e 100644 (file)
@@ -102,9 +102,7 @@ defmodule Pleroma.Web.ConnCase do
               end)
 
             flunk(
-              "Response does not conform to schema of #{op_id} operation: #{
-                Enum.join(errors, "\n")
-              }\n#{inspect(json)}"
+              "Response does not conform to schema of #{op_id} operation: #{Enum.join(errors, "\n")}\n#{inspect(json)}"
             )
         end
       end
index 8807c2d14679551e778c3cfe2661cefb6a54aec4..94900dc144944665c6912e30ecd86d355fbfc408 100644 (file)
@@ -1313,9 +1313,7 @@ defmodule HttpRequestMock do
 
   def get(url, query, body, headers) do
     {:error,
-     "Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{
-       inspect(headers)
-     }"}
+     "Mock response not implemented for GET #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"}
   end
 
   # POST Requests
@@ -1381,9 +1379,7 @@ defmodule HttpRequestMock do
 
   def post(url, query, body, headers) do
     {:error,
-     "Mock response not implemented for POST #{inspect(url)}, #{query}, #{inspect(body)}, #{
-       inspect(headers)
-     }"}
+     "Mock response not implemented for POST #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"}
   end
 
   # Most of the rich media mocks are missing HEAD requests, so we just return 404.
@@ -1398,8 +1394,6 @@ defmodule HttpRequestMock do
 
   def head(url, query, body, headers) do
     {:error,
-     "Mock response not implemented for HEAD #{inspect(url)}, #{query}, #{inspect(body)}, #{
-       inspect(headers)
-     }"}
+     "Mock response not implemented for HEAD #{inspect(url)}, #{query}, #{inspect(body)}, #{inspect(headers)}"}
   end
 end