From: Ariadne Conill Date: Tue, 13 Aug 2019 22:36:24 +0000 (+0000) Subject: fix credo X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=4244e17de0da9978bad6afb1922a3e9cf36996bb;p=akkoma fix credo --- diff --git a/lib/pleroma/web/activity_pub/mrf.ex b/lib/pleroma/web/activity_pub/mrf.ex index 7533552d5..263ed11af 100644 --- a/lib/pleroma/web/activity_pub/mrf.ex +++ b/lib/pleroma/web/activity_pub/mrf.ex @@ -59,12 +59,12 @@ defmodule Pleroma.Web.ActivityPub.MRF do base = %{ mrf_policies: mrf_policies, - exclusions: length(exclusions) > 0, + exclusions: length(exclusions) > 0 } |> Map.merge(policy_configs) {:ok, base} end - def describe(), do: get_policies() |> describe() + def describe, do: get_policies() |> describe() end diff --git a/lib/pleroma/web/activity_pub/mrf/anti_followbot_policy.ex b/lib/pleroma/web/activity_pub/mrf/anti_followbot_policy.ex index ad2d9bf54..de1eb4aa5 100644 --- a/lib/pleroma/web/activity_pub/mrf/anti_followbot_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/anti_followbot_policy.ex @@ -64,5 +64,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicy do def filter(message), do: {:ok, message} @impl true - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/anti_link_spam_policy.ex b/lib/pleroma/web/activity_pub/mrf/anti_link_spam_policy.ex index d27386591..b90193ca0 100644 --- a/lib/pleroma/web/activity_pub/mrf/anti_link_spam_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/anti_link_spam_policy.ex @@ -50,5 +50,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicy do def filter(message), do: {:ok, message} @impl true - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/drop_policy.ex b/lib/pleroma/web/activity_pub/mrf/drop_policy.ex index dcb640b12..f7831bc3e 100644 --- a/lib/pleroma/web/activity_pub/mrf/drop_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/drop_policy.ex @@ -14,5 +14,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.DropPolicy do end @impl true - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/ensure_re_prepended.ex b/lib/pleroma/web/activity_pub/mrf/ensure_re_prepended.ex index df8dc88d5..3a3e72910 100644 --- a/lib/pleroma/web/activity_pub/mrf/ensure_re_prepended.ex +++ b/lib/pleroma/web/activity_pub/mrf/ensure_re_prepended.ex @@ -40,5 +40,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.EnsureRePrepended do def filter(object), do: {:ok, object} - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex b/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex index ef717fa43..9863454fa 100644 --- a/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/hellthread_policy.ex @@ -92,5 +92,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.HellthreadPolicy do def filter(message), do: {:ok, message} @impl true - def describe(), do: {:ok, %{mrf_hellthread: Pleroma.Config.get([:mrf_hellthread])}} + def describe, do: {:ok, %{mrf_hellthread: Pleroma.Config.get([:mrf_hellthread])}} end diff --git a/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex b/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex index fbfe7a7eb..d6d1396bc 100644 --- a/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/keyword_policy.ex @@ -98,7 +98,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.KeywordPolicy do def filter(message), do: {:ok, message} @impl true - def describe() do + def describe do # This horror is needed to convert regex sigils to strings mrf_keyword = Pleroma.Config.get(:mrf_keyword, []) diff --git a/lib/pleroma/web/activity_pub/mrf/mediaproxy_warming_policy.ex b/lib/pleroma/web/activity_pub/mrf/mediaproxy_warming_policy.ex index f38b42794..a179dd54d 100644 --- a/lib/pleroma/web/activity_pub/mrf/mediaproxy_warming_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/mediaproxy_warming_policy.ex @@ -55,5 +55,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy do def filter(message), do: {:ok, message} @impl true - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/mention_policy.ex b/lib/pleroma/web/activity_pub/mrf/mention_policy.ex index 49717d45d..ce8bc4580 100644 --- a/lib/pleroma/web/activity_pub/mrf/mention_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/mention_policy.ex @@ -23,5 +23,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.MentionPolicy do def filter(message), do: {:ok, message} @impl true - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/no_placeholder_text_policy.ex b/lib/pleroma/web/activity_pub/mrf/no_placeholder_text_policy.ex index 6fc9544a0..f67f48ab6 100644 --- a/lib/pleroma/web/activity_pub/mrf/no_placeholder_text_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/no_placeholder_text_policy.ex @@ -21,5 +21,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.NoPlaceholderTextPolicy do def filter(object), do: {:ok, object} @impl true - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/noop_policy.ex b/lib/pleroma/web/activity_pub/mrf/noop_policy.ex index 19890ef0c..878c57925 100644 --- a/lib/pleroma/web/activity_pub/mrf/noop_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/noop_policy.ex @@ -12,5 +12,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.NoOpPolicy do end @impl true - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex b/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex index b684a3505..daa4c88ad 100644 --- a/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex +++ b/lib/pleroma/web/activity_pub/mrf/normalize_markup.ex @@ -22,5 +22,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.NormalizeMarkup do def filter(object), do: {:ok, object} - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/reject_non_public.ex b/lib/pleroma/web/activity_pub/mrf/reject_non_public.ex index 39ebf456a..0ae9397ed 100644 --- a/lib/pleroma/web/activity_pub/mrf/reject_non_public.ex +++ b/lib/pleroma/web/activity_pub/mrf/reject_non_public.ex @@ -46,5 +46,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.RejectNonPublic do def filter(object), do: {:ok, object} @impl true - def describe(), do: {:ok, %{mrf_rejectnonpublic: Pleroma.Config.get([:mrf_rejectnonpublic])}} + def describe, do: {:ok, %{mrf_rejectnonpublic: Pleroma.Config.get([:mrf_rejectnonpublic])}} end diff --git a/lib/pleroma/web/activity_pub/mrf/simple_policy.ex b/lib/pleroma/web/activity_pub/mrf/simple_policy.ex index 89e0e3d54..8aa6852f0 100644 --- a/lib/pleroma/web/activity_pub/mrf/simple_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/simple_policy.ex @@ -179,7 +179,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.SimplePolicy do def filter(object), do: {:ok, object} @impl true - def describe() do + def describe do exclusions = Pleroma.Config.get([:instance, :mrf_transparency_exclusions]) mrf_simple = diff --git a/lib/pleroma/web/activity_pub/mrf/subchain_policy.ex b/lib/pleroma/web/activity_pub/mrf/subchain_policy.ex index b69410ca8..566c1e191 100644 --- a/lib/pleroma/web/activity_pub/mrf/subchain_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/subchain_policy.ex @@ -39,5 +39,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.SubchainPolicy do def filter(message), do: {:ok, message} @impl true - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/tag_policy.ex b/lib/pleroma/web/activity_pub/mrf/tag_policy.ex index 95864156f..c1801d2ec 100644 --- a/lib/pleroma/web/activity_pub/mrf/tag_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/tag_policy.ex @@ -167,5 +167,5 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicy do def filter(message), do: {:ok, message} @impl true - def describe(), do: {:ok, %{}} + def describe, do: {:ok, %{}} end diff --git a/lib/pleroma/web/activity_pub/mrf/user_allowlist_policy.ex b/lib/pleroma/web/activity_pub/mrf/user_allowlist_policy.ex index c2597da8f..7389d6a96 100644 --- a/lib/pleroma/web/activity_pub/mrf/user_allowlist_policy.ex +++ b/lib/pleroma/web/activity_pub/mrf/user_allowlist_policy.ex @@ -34,7 +34,7 @@ defmodule Pleroma.Web.ActivityPub.MRF.UserAllowListPolicy do def filter(object), do: {:ok, object} @impl true - def describe() do + def describe do mrf_user_allowlist = Config.get([:mrf_user_allowlist], []) |> Enum.into(%{}, fn {k, v} -> {k, length(v)} end) diff --git a/test/support/mrf_module_mock.ex b/test/support/mrf_module_mock.ex index 573eb0147..12c7e22bc 100644 --- a/test/support/mrf_module_mock.ex +++ b/test/support/mrf_module_mock.ex @@ -9,5 +9,5 @@ defmodule MRFModuleMock do def filter(message), do: {:ok, message} @impl true - def describe(), do: {:ok, %{mrf_module_mock: "some config data"}} + def describe, do: {:ok, %{mrf_module_mock: "some config data"}} end