From: lain Date: Mon, 10 Dec 2018 18:13:53 +0000 (+0100) Subject: Treat warnings as errors outside of tests. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=c81c74d84715b25447840cf8536ac4ba0a4e98f1;p=akkoma Treat warnings as errors outside of tests. --- diff --git a/lib/pleroma/web/federator/federator.ex b/lib/pleroma/web/federator/federator.ex index 6dbf07e13..a9c7aecd5 100644 --- a/lib/pleroma/web/federator/federator.ex +++ b/lib/pleroma/web/federator/federator.ex @@ -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 bd9bce766..1283ca33f 100644 --- 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(), diff --git a/test/support/builders/activity_builder.ex b/test/support/builders/activity_builder.ex index eb72d5ba9..6e5a8e059 100644 --- a/test/support/builders/activity_builder.ex +++ b/test/support/builders/activity_builder.ex @@ -1,5 +1,4 @@ defmodule Pleroma.Builders.ActivityBuilder do - alias Pleroma.Builders.UserBuilder alias Pleroma.Web.ActivityPub.ActivityPub def build(data \\ %{}, opts \\ %{}) do diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index 391342ad7..6f98fc5d0 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -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 index 000000000..0cba0b740 --- /dev/null +++ b/test/support/websub_mock.ex @@ -0,0 +1,5 @@ +defmodule Pleroma.Web.WebsubMock do + def verify(sub) do + {:ok, sub} + end +end diff --git a/test/web/websub/websub_test.exs b/test/web/websub/websub_test.exs index 47d1a88e1..fd559743f 100644 --- a/test/web/websub/websub_test.exs +++ b/test/web/websub/websub_test.exs @@ -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