Treat warnings as errors outside of tests.
authorlain <lain@soykaf.club>
Mon, 10 Dec 2018 18:13:53 +0000 (19:13 +0100)
committerlain <lain@soykaf.club>
Mon, 10 Dec 2018 18:13:53 +0000 (19:13 +0100)
lib/pleroma/web/federator/federator.ex
mix.exs
test/support/builders/activity_builder.ex
test/support/http_request_mock.ex
test/support/websub_mock.ex [new file with mode: 0644]
test/web/websub/websub_test.exs

index 6dbf07e1320ab6db277db5853e9d7186846af1a6..a9c7aecd52da40d72fe760820722c246e6430859 100644 (file)
@@ -150,7 +150,7 @@ defmodule Pleroma.Web.Federator do
   end
 
   if Mix.env() == :test do
-    def enqueue(type, payload, priority \\ 1) do
+    def enqueue(type, payload, _priority \\ 1) do
       if Pleroma.Config.get([:instance, :federating]) do
         handle(type, payload)
       end
diff --git a/mix.exs b/mix.exs
index bd9bce7665c7b99fce4adf9cb98d109f1011bb47..1283ca33f16df3f18775fc666b4825ad7d103215 100644 (file)
--- a/mix.exs
+++ b/mix.exs
@@ -8,6 +8,11 @@ defmodule Pleroma.Mixfile do
       elixir: "~> 1.4",
       elixirc_paths: elixirc_paths(Mix.env()),
       compilers: [:phoenix, :gettext] ++ Mix.compilers(),
+      elixirc_options: if Mix.env() == :test do
+        []
+      else
+        [warnings_as_errors: true]
+      end,
       start_permanent: Mix.env() == :prod,
       aliases: aliases(),
       deps: deps(),
index eb72d5ba9ab06578531028ff5fd7787ada150dbc..6e5a8e0594aab4a41e2980837aceca7b6158899e 100644 (file)
@@ -1,5 +1,4 @@
 defmodule Pleroma.Builders.ActivityBuilder do
-  alias Pleroma.Builders.UserBuilder
   alias Pleroma.Web.ActivityPub.ActivityPub
 
   def build(data \\ %{}, opts \\ %{}) do
index 391342ad78bf464ae8331352d9f7b05b3a5ee40c..6f98fc5d0c347ae0de6a3c2ee2f1a9536a2aee36 100644 (file)
@@ -13,7 +13,7 @@ defmodule HttpRequestMock do
     with {:ok, res} <- apply(__MODULE__, method, [url, query, body, headers]) do
       res
     else
-      {_, r} = error ->
+      {_, _r} = error ->
         # Logger.warn(r)
         error
     end
diff --git a/test/support/websub_mock.ex b/test/support/websub_mock.ex
new file mode 100644 (file)
index 0000000..0cba0b7
--- /dev/null
@@ -0,0 +1,5 @@
+defmodule Pleroma.Web.WebsubMock do
+  def verify(sub) do
+    {:ok, sub}
+  end
+end
index 47d1a88e183feb04bb16f1b810810cd05083b198..fd559743f294fd920efd40a8835976fb766389c9 100644 (file)
@@ -1,9 +1,3 @@
-defmodule Pleroma.Web.WebsubMock do
-  def verify(sub) do
-    {:ok, sub}
-  end
-end
-
 defmodule Pleroma.Web.WebsubTest do
   use Pleroma.DataCase
   alias Pleroma.Web.Websub