Fix warnings
authorEgor Kislitsyn <egor@kislitsyn.com>
Thu, 15 Oct 2020 12:54:59 +0000 (16:54 +0400)
committerEgor Kislitsyn <egor@kislitsyn.com>
Thu, 15 Oct 2020 12:54:59 +0000 (16:54 +0400)
17 files changed:
lib/pleroma/web/templates/layout/app.html.eex
lib/pleroma/web/templates/layout/email_styled.html.eex
lib/pleroma/web/templates/layout/metadata_player.html.eex
lib/pleroma/web/templates/layout/static_fe.html.eex
test/pleroma/notification_test.exs
test/pleroma/web/activity_pub/activity_pub_test.exs
test/pleroma/web/activity_pub/mrf/reject_non_public_test.exs
test/pleroma/web/activity_pub/mrf/tag_policy_test.exs
test/pleroma/web/activity_pub/transmogrifier/announce_handling_test.exs
test/pleroma/web/activity_pub/transmogrifier_test.exs
test/pleroma/web/common_api_test.exs
test/pleroma/web/fed_sockets/fed_registry_test.exs
test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
test/pleroma/web/mastodon_api/controllers/status_controller_test.exs
test/pleroma/web/o_auth/o_auth_controller_test.exs
test/pleroma/web/pleroma_api/controllers/emoji_pack_controller_test.exs
test/pleroma/web/pleroma_api/controllers/mascot_controller_test.exs

index 51603fe0ca1b95be0d11e204fd2c82ef166449a9..3f28f1920a1816d760ec65e9173f559f084392e1 100644 (file)
   <body>
     <div class="container">
       <h1><%= Pleroma.Config.get([:instance, :name]) %></h1>
-      <%= render @view_module, @view_template, assigns %>
+      <%= @inner_content %>
     </div>
   </body>
 </html>
index ca2caaf4dece1bcdd8b93abed7362cb6718e7998..82cabd8898ba2c04ac18811a49cb8f201916eb3c 100644 (file)
                                                        </div>
                                                </div>
                                        <% end %>
-                                       <%= render @view_module, @view_template, assigns %>
+                                       <%= @inner_content %>
 
                                </td>
                        </tr>
index 460f280944a83d7cbbee59b4bd5705dd7f52434b..c00f6fa2136f83667b546978a624410a16ded788 100644 (file)
@@ -10,7 +10,7 @@ video, audio {
 }
 </style>
 
-<%= render @view_module, @view_template, assigns %>
+<%= @inner_content %>
 
 </body>
 </html>
index dc0ee2a5c8272614f720cecaf41544ae438cc225..e6adb526bce85576e6805be0746ae867a9fedee7 100644 (file)
@@ -9,7 +9,7 @@
   </head>
   <body>
     <div class="container">
-      <%= render @view_module, @view_template, assigns %>
+      <%= @inner_content %>
     </div>
   </body>
 </html>
index f2e0f0b0d8ccfa26ae7b6cc5c3f4cc33893e07c1..ac43096fb21ad62bdbc15e77e8b1904d86a0da0f 100644 (file)
@@ -400,7 +400,7 @@ defmodule Pleroma.NotificationTest do
       user = insert(:user, locked: true)
       follower = insert(:user)
       {:ok, _, _, _follow_activity} = CommonAPI.follow(follower, user)
-      assert [notification] = Notification.for_user(user)
+      assert [_notification] = Notification.for_user(user)
       {:ok, _follower} = CommonAPI.reject_follow_request(follower, user)
       assert [] = Notification.for_user(user)
     end
index 804305a1381321e35c4ae38dcc8d67febcecf5de..9f641ae1cf70ea96e3b8491e6607cd91512948fe 100644 (file)
@@ -505,22 +505,22 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do
 
       # public
       {:ok, _} = CommonAPI.post(user2, Map.put(reply_data, :visibility, "public"))
-      assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
+      assert %{data: _data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
       assert object.data["repliesCount"] == 1
 
       # unlisted
       {:ok, _} = CommonAPI.post(user2, Map.put(reply_data, :visibility, "unlisted"))
-      assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
+      assert %{data: _data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
       assert object.data["repliesCount"] == 2
 
       # private
       {:ok, _} = CommonAPI.post(user2, Map.put(reply_data, :visibility, "private"))
-      assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
+      assert %{data: _data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
       assert object.data["repliesCount"] == 2
 
       # direct
       {:ok, _} = CommonAPI.post(user2, Map.put(reply_data, :visibility, "direct"))
-      assert %{data: data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
+      assert %{data: _data, object: object} = Activity.get_by_ap_id_with_object(ap_id)
       assert object.data["repliesCount"] == 2
     end
   end
index 58b46b9a2cf41d0d960236306d1c4b3db97ce156..e08eb3ba6bb9c77235293154f30759cc6f0cbf4c 100644 (file)
@@ -21,7 +21,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublicTest do
         "type" => "Create"
       }
 
-      assert {:ok, message} = RejectNonPublic.filter(message)
+      assert {:ok, _message} = RejectNonPublic.filter(message)
     end
 
     test "it's allowed when cc address contain public address" do
@@ -34,7 +34,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublicTest do
         "type" => "Create"
       }
 
-      assert {:ok, message} = RejectNonPublic.filter(message)
+      assert {:ok, _message} = RejectNonPublic.filter(message)
     end
   end
 
@@ -50,7 +50,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublicTest do
       }
 
       Pleroma.Config.put([:mrf_rejectnonpublic, :allow_followersonly], true)
-      assert {:ok, message} = RejectNonPublic.filter(message)
+      assert {:ok, _message} = RejectNonPublic.filter(message)
     end
 
     test "it's rejected when addrer of message in the follower addresses of user and it disabled in config" do
@@ -80,7 +80,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublicTest do
       }
 
       Pleroma.Config.put([:mrf_rejectnonpublic, :allow_direct], true)
-      assert {:ok, message} = RejectNonPublic.filter(message)
+      assert {:ok, _message} = RejectNonPublic.filter(message)
     end
 
     test "it's reject when direct messages aren't allow" do
index 6ff71d6408358fd1471b21674892a05986d95920..ffc30ba6281e03140c3ac41bf2d5bf07b95f0d98 100644 (file)
@@ -29,7 +29,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicyTest do
       actor = insert(:user, tags: ["mrf_tag:disable-remote-subscription"])
       follower = insert(:user, tags: ["mrf_tag:disable-remote-subscription"], local: true)
       message = %{"object" => actor.ap_id, "type" => "Follow", "actor" => follower.ap_id}
-      assert {:ok, message} = TagPolicy.filter(message)
+      assert {:ok, _message} = TagPolicy.filter(message)
     end
   end
 
index e895636b550097ecd53770d03c394e6fa7a2dc94..54335acdbb011c9f126d63badb7c49f0fec126d5 100644 (file)
@@ -144,7 +144,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.AnnounceHandlingTest do
 
     _user = insert(:user, local: false, ap_id: data["actor"])
 
-    assert {:error, e} = Transmogrifier.handle_incoming(data)
+    assert {:error, _e} = Transmogrifier.handle_incoming(data)
   end
 
   test "it does not clobber the addressing on announce activities" do
index 561674f010c1e6c748f0c9faca171beb267bec7a..4547c84b7594e1af2d0004149c69592d25142e5e 100644 (file)
@@ -101,7 +101,7 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
       {:ok, returned_activity} = Transmogrifier.handle_incoming(data)
       returned_object = Object.normalize(returned_activity, false)
 
-      assert activity =
+      assert %Activity{} =
                Activity.get_create_by_object_ap_id(
                  "https://mstdn.io/users/mayuutann/statuses/99568293732299394"
                )
index e34f5a49b39b8ae7f29ba6c03ac66cb503497b80..aabfc6db8340275f18cd1261a618ad298253956a 100644 (file)
@@ -622,7 +622,7 @@ defmodule Pleroma.Web.CommonAPITest do
       assert {:error, "The status is over the character limit"} =
                CommonAPI.post(user, %{status: "foobar"})
 
-      assert {:ok, activity} = CommonAPI.post(user, %{status: "12345"})
+      assert {:ok, _activity} = CommonAPI.post(user, %{status: "12345"})
     end
 
     test "it can handle activities that expire" do
index 19ac874d691d9e51393bfda340aec2f322514b50..73aaced4615534451b05dca3074f19f02018032c 100644 (file)
@@ -52,7 +52,7 @@ defmodule Pleroma.Web.FedSockets.FedRegistryTest do
     end
 
     test "will be ignored" do
-      assert {:ok, %SocketInfo{origin: origin, pid: pid_one}} =
+      assert {:ok, %SocketInfo{origin: origin, pid: _pid_one}} =
                FedRegistry.get_fed_socket(@good_domain_origin)
 
       assert origin == "good.domain:80"
@@ -63,7 +63,7 @@ defmodule Pleroma.Web.FedSockets.FedRegistryTest do
     test "the newer process will be closed" do
       pid_two = build_test_socket(@good_domain)
 
-      assert {:ok, %SocketInfo{origin: origin, pid: pid_one}} =
+      assert {:ok, %SocketInfo{origin: origin, pid: _pid_one}} =
                FedRegistry.get_fed_socket(@good_domain_origin)
 
       assert origin == "good.domain:80"
index f7f1369e48e35d70a19d925a2a3c2d2f66a05b00..fbce5665a32f366c51a7f4e8644c2ba51628b37f 100644 (file)
@@ -32,7 +32,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
     test "works by nickname" do
       user = insert(:user)
 
-      assert %{"id" => user_id} =
+      assert %{"id" => _user_id} =
                build_conn()
                |> get("/api/v1/accounts/#{user.nickname}")
                |> json_response_and_validate_schema(200)
@@ -43,7 +43,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
 
       user = insert(:user, nickname: "user@example.com", local: false)
 
-      assert %{"id" => user_id} =
+      assert %{"id" => _user_id} =
                build_conn()
                |> get("/api/v1/accounts/#{user.nickname}")
                |> json_response_and_validate_schema(200)
@@ -1429,10 +1429,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
     test "returns lists to which the account belongs" do
       %{user: user, conn: conn} = oauth_access(["read:lists"])
       other_user = insert(:user)
-      assert {:ok, %Pleroma.List{id: list_id} = list} = Pleroma.List.create("Test List", user)
+      assert {:ok, %Pleroma.List{id: _list_id} = list} = Pleroma.List.create("Test List", user)
       {:ok, %{following: _following}} = Pleroma.List.follow(list, other_user)
 
-      assert [%{"id" => list_id, "title" => "Test List"}] =
+      assert [%{"id" => _list_id, "title" => "Test List"}] =
                conn
                |> get("/api/v1/accounts/#{other_user.id}/lists")
                |> json_response_and_validate_schema(200)
index 633a25e506b1ee3cdf779bcf81d8423956966424..497a6bb1207814a09be483c9c322a4462b33eeb3 100644 (file)
@@ -937,7 +937,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
         |> get("/api/v1/statuses/#{reblog_activity1.id}")
 
       assert %{
-               "reblog" => %{"id" => id, "reblogged" => false, "reblogs_count" => 2},
+               "reblog" => %{"id" => _id, "reblogged" => false, "reblogs_count" => 2},
                "reblogged" => false,
                "favourited" => false,
                "bookmarked" => false
index 1200126b81dca7b5b45be13b95447dc8eed6d3a2..a00df8cc7e6e191cdbf0f87b622ff37d0e03edea 100644 (file)
@@ -77,7 +77,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
           }
         )
 
-      assert response = html_response(conn, 302)
+      assert html_response(conn, 302)
 
       redirect_query = URI.parse(redirected_to(conn)).query
       assert %{"state" => state_param} = URI.decode_query(redirect_query)
@@ -119,7 +119,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
           }
         )
 
-      assert response = html_response(conn, 302)
+      assert html_response(conn, 302)
       assert redirected_to(conn) =~ ~r/#{redirect_uri}\?code=.+/
     end
 
@@ -182,7 +182,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
           }
         )
 
-      assert response = html_response(conn, 302)
+      assert html_response(conn, 302)
       assert redirected_to(conn) == app.redirect_uris
       assert get_flash(conn, :error) == "Failed to authenticate: (error description)."
     end
@@ -238,7 +238,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
           }
         )
 
-      assert response = html_response(conn, 302)
+      assert html_response(conn, 302)
       assert redirected_to(conn) =~ ~r/#{redirect_uri}\?code=.+/
     end
 
@@ -268,7 +268,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
           }
         )
 
-      assert response = html_response(conn, 401)
+      assert html_response(conn, 401)
     end
 
     test "with invalid params, POST /oauth/register?op=register renders registration_details page",
@@ -336,7 +336,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
           }
         )
 
-      assert response = html_response(conn, 302)
+      assert html_response(conn, 302)
       assert redirected_to(conn) =~ ~r/#{redirect_uri}\?code=.+/
     end
 
@@ -367,7 +367,7 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
           }
         )
 
-      assert response = html_response(conn, 401)
+      assert html_response(conn, 401)
     end
 
     test "with invalid params, POST /oauth/register?op=connect renders registration_details page",
index 386ad8634e40ad88af15a3f5d220d66baa4fab5b..3445f0ca043173879a9e7e9af218f1c1d24c213c 100644 (file)
@@ -569,7 +569,7 @@ defmodule Pleroma.Web.PleromaAPI.EmojiPackControllerTest do
 
     test "for pack name with special chars", %{conn: conn} do
       assert %{
-               "files" => files,
+               "files" => _files,
                "files_count" => 1,
                "pack" => %{
                  "can-download" => true,
index e2ead6e154e85c77b215e069984f67a62c2d75e1..2f509410e132f539e3779591b4592003e780681a 100644 (file)
@@ -34,7 +34,7 @@ defmodule Pleroma.Web.PleromaAPI.MascotControllerTest do
       |> put_req_header("content-type", "multipart/form-data")
       |> put("/api/v1/pleroma/mascot", %{"file" => file})
 
-    assert %{"id" => _, "type" => image} = json_response_and_validate_schema(conn, 200)
+    assert %{"id" => _, "type" => _image} = json_response_and_validate_schema(conn, 200)
   end
 
   test "mascot retrieving" do