Remove duplicate @doc blocs

Elixir 11 notifies this a lot

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-11-06 15:43:38 +01:00
parent 7c11807c14
commit 44559a71ee
16 changed files with 67 additions and 113 deletions

View File

@@ -12,7 +12,7 @@ defmodule Mobilizon.GraphQL.Resolvers.FeedToken do
require Logger
@doc """
Create an feed token for an user and a defined actor
Create an feed token for an user and optionally a defined actor
"""
@spec create_feed_token(any, map, map) :: {:ok, FeedToken.t()} | {:error, String.t()}
def create_feed_token(
@@ -29,9 +29,6 @@ defmodule Mobilizon.GraphQL.Resolvers.FeedToken do
end
end
@doc """
Create an feed token for an user
"""
@spec create_feed_token(any, map, map) :: {:ok, FeedToken.t()}
def create_feed_token(_parent, %{}, %{context: %{current_user: %User{id: id}}}) do
with {:ok, feed_token} <- Events.create_feed_token(%{user_id: id}) do

View File

@@ -42,9 +42,6 @@ defmodule Mobilizon.GraphQL.Resolvers.Group do
end
end
@doc """
Find a group
"""
def find_group(_parent, %{preferred_username: name}, _resolution) do
with {:ok, actor} <- ActivityPub.find_or_make_group_from_nickname(name),
%Actor{} = actor <- Person.proxify_pictures(actor),

View File

@@ -14,7 +14,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Participant do
import Mobilizon.Web.Gettext
@doc """
Join an event for an regular actor
Join an event for an regular or anonymous actor
"""
def actor_join_event(
_parent,
@@ -30,9 +30,6 @@ defmodule Mobilizon.GraphQL.Resolvers.Participant do
end
end
@doc """
Join an event for an anonymous actor
"""
def actor_join_event(
_parent,
%{actor_id: actor_id, event_id: event_id} = args,

View File

@@ -126,9 +126,6 @@ defmodule Mobilizon.GraphQL.Resolvers.Person do
end
end
@doc """
This function is used to create more identities from an existing user
"""
def create_person(_parent, _args, _resolution) do
{:error, :unauthenticated}
end
@@ -240,7 +237,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Person do
end
@doc """
Returns the participation for a specific event
Returns the participations, optionally restricted to an event
"""
def person_participations(
%Actor{id: actor_id},
@@ -260,9 +257,6 @@ defmodule Mobilizon.GraphQL.Resolvers.Person do
end
end
@doc """
Returns the list of events this person is going to
"""
def person_participations(%Actor{id: actor_id} = actor, %{page: page, limit: limit}, %{
context: %{current_user: %User{role: role} = user}
}) do

View File

@@ -10,17 +10,14 @@ defmodule Mobilizon.GraphQL.Resolvers.Picture do
import Mobilizon.Web.Gettext
@doc """
Get picture for an event's pic
Get picture for an event
See Mobilizon.Web.Resolvers.Event.create_event/3
"""
def picture(%{picture_id: picture_id} = _parent, _args, _resolution) do
with {:ok, picture} <- do_fetch_picture(picture_id), do: {:ok, picture}
end
@doc """
Get picture for an event that has an attached
See Mobilizon.Web.Resolvers.Event.create_event/3
"""
def picture(%{picture: picture} = _parent, _args, _resolution), do: {:ok, picture}
def picture(_parent, %{id: picture_id}, _resolution), do: do_fetch_picture(picture_id)
def picture(_parent, _args, _resolution), do: {:ok, nil}

View File

@@ -44,7 +44,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Report do
end
@doc """
Create a report
Create a report, either logged-in or anonymously
"""
def create_report(
_parent,
@@ -63,9 +63,6 @@ defmodule Mobilizon.GraphQL.Resolvers.Report do
end
end
@doc """
Create a report anonymously if allowed
"""
def create_report(
_parent,
%{reporter_id: reporter_id} = args,

View File

@@ -15,14 +15,14 @@ defmodule Mobilizon.GraphQL.Resolvers.Tag do
@doc """
Retrieve the list of tags for an event
From an event or a struct with an url
"""
def list_tags_for_event(%Event{id: id}, _args, _resolution) do
{:ok, Events.list_tags_for_event(id)}
end
@doc """
Retrieve the list of tags for an event
"""
# TODO: Check that I'm actually used
def list_tags_for_event(%{url: url}, _args, _resolution) do
with %Event{id: event_id} <- Events.get_event_by_url(url) do
{:ok, Events.list_tags_for_event(event_id)}