projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8bcfac9
)
Credo fixes: parameter consistency
author
Haelwenn (lanodan) Monnier
<contact@hacktivis.me>
Wed, 6 Feb 2019 19:19:39 +0000
(20:19 +0100)
committer
Haelwenn (lanodan) Monnier
<contact@hacktivis.me>
Sat, 9 Feb 2019 13:59:20 +0000
(14:59 +0100)
lib/pleroma/flake_id.ex
patch
|
blob
|
history
lib/pleroma/gopher/server.ex
patch
|
blob
|
history
lib/pleroma/plugs/instance_static.ex
patch
|
blob
|
history
lib/pleroma/plugs/uploaded_media.ex
patch
|
blob
|
history
lib/pleroma/upload.ex
patch
|
blob
|
history
lib/pleroma/upload/filter/dedupe.ex
patch
|
blob
|
history
lib/pleroma/uploaders/s3.ex
patch
|
blob
|
history
lib/pleroma/web/common_api/utils.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/flake_id.ex
b/lib/pleroma/flake_id.ex
index 69ab8ccf929f10184968a009f76fce5aa3384392..9f098ce3378f0ce5deeb2ea2bb03e9804e56f80d 100644
(file)
--- a/
lib/pleroma/flake_id.ex
+++ b/
lib/pleroma/flake_id.ex
@@
-27,7
+27,7
@@
defmodule Pleroma.FlakeId do
Kernel.to_string(id)
end
Kernel.to_string(id)
end
- def to_string(
flake = <<_::integer-size(64), _::integer-size(48), _::integer-size(16)>>
) do
+ def to_string(
<<_::integer-size(64), _::integer-size(48), _::integer-size(16)>> = flake
) do
encode_base62(flake)
end
encode_base62(flake)
end
@@
-42,7
+42,7
@@
defmodule Pleroma.FlakeId do
def from_string(unquote(Kernel.to_string(i))), do: <<0::integer-size(128)>>
end
def from_string(unquote(Kernel.to_string(i))), do: <<0::integer-size(128)>>
end
- def from_string(
flake = <<_::integer-size(128)>>
), do: flake
+ def from_string(
<<_::integer-size(128)>> = flake
), do: flake
def from_string(string) when is_binary(string) and byte_size(string) < 18 do
case Integer.parse(string) do
def from_string(string) when is_binary(string) and byte_size(string) < 18 do
case Integer.parse(string) do
diff --git
a/lib/pleroma/gopher/server.ex
b/lib/pleroma/gopher/server.ex
index 336142e9b288aa7160bcc5f3c6b5a884a7b2a932..b47a0697d9da48f4621a0f051f2883ab8c17c1a9 100644
(file)
--- a/
lib/pleroma/gopher/server.ex
+++ b/
lib/pleroma/gopher/server.ex
@@
-47,7
+47,7
@@
defmodule Pleroma.Gopher.Server.ProtocolHandler do
{:ok, pid}
end
{:ok, pid}
end
- def init(ref, socket, transport,
_Opts = []
) do
+ def init(ref, socket, transport,
[] = _Opts
) do
:ok = :ranch.accept_ack(ref)
loop(socket, transport)
end
:ok = :ranch.accept_ack(ref)
loop(socket, transport)
end
diff --git
a/lib/pleroma/plugs/instance_static.ex
b/lib/pleroma/plugs/instance_static.ex
index 11f108de74f46ac8f20bfeca839d23476bc88fcd..41125921a9818ae1a5a045bfa85ffae3dd445f9f 100644
(file)
--- a/
lib/pleroma/plugs/instance_static.ex
+++ b/
lib/pleroma/plugs/instance_static.ex
@@
-33,7
+33,7
@@
defmodule Pleroma.Plugs.InstanceStatic do
for only <- @only do
at = Plug.Router.Utils.split("/")
for only <- @only do
at = Plug.Router.Utils.split("/")
- def call(
conn = %{request_path: "/" <> unquote(only) <> _}
, opts) do
+ def call(
%{request_path: "/" <> unquote(only) <> _} = conn
, opts) do
call_static(
conn,
opts,
call_static(
conn,
opts,
diff --git
a/lib/pleroma/plugs/uploaded_media.ex
b/lib/pleroma/plugs/uploaded_media.ex
index be53ac00cd7ae8a62e386a4584879b5fe19f6d76..13aa8641afcb2444d195ac87298d98fbb2c8f589 100644
(file)
--- a/
lib/pleroma/plugs/uploaded_media.ex
+++ b/
lib/pleroma/plugs/uploaded_media.ex
@@
-23,7
+23,7
@@
defmodule Pleroma.Plugs.UploadedMedia do
%{static_plug_opts: static_plug_opts}
end
%{static_plug_opts: static_plug_opts}
end
- def call(
conn = %{request_path: <<"/", @path, "/", file::binary>>}
, opts) do
+ def call(
%{request_path: <<"/", @path, "/", file::binary>>} = conn
, opts) do
config = Pleroma.Config.get([Pleroma.Upload])
with uploader <- Keyword.fetch!(config, :uploader),
config = Pleroma.Config.get([Pleroma.Upload])
with uploader <- Keyword.fetch!(config, :uploader),
diff --git
a/lib/pleroma/upload.ex
b/lib/pleroma/upload.ex
index ce2a1b69633344607415767f4d58bb9ffdfda8af..91a5db8c524f6e24b4b122c267cc5afd0a7c1a38 100644
(file)
--- a/
lib/pleroma/upload.ex
+++ b/
lib/pleroma/upload.ex
@@
-180,7
+180,7
@@
defmodule Pleroma.Upload do
end
# For Mix.Tasks.MigrateLocalUploads
end
# For Mix.Tasks.MigrateLocalUploads
- defp prepare_upload(
upload = %__MODULE__{tempfile: path}
, _opts) do
+ defp prepare_upload(
%__MODULE__{tempfile: path} = upload
, _opts) do
with {:ok, content_type} <- Pleroma.MIME.file_mime_type(path) do
{:ok, %__MODULE__{upload | content_type: content_type}}
end
with {:ok, content_type} <- Pleroma.MIME.file_mime_type(path) do
{:ok, %__MODULE__{upload | content_type: content_type}}
end
diff --git
a/lib/pleroma/upload/filter/dedupe.ex
b/lib/pleroma/upload/filter/dedupe.ex
index 8fcce320f57db7974808f919ed01aa7bec6c3eef..e4c2258334e3a4aa754d7bbffd232df7f3be0feb 100644
(file)
--- a/
lib/pleroma/upload/filter/dedupe.ex
+++ b/
lib/pleroma/upload/filter/dedupe.ex
@@
-6,7
+6,7
@@
defmodule Pleroma.Upload.Filter.Dedupe do
@behaviour Pleroma.Upload.Filter
alias Pleroma.Upload
@behaviour Pleroma.Upload.Filter
alias Pleroma.Upload
- def filter(
upload = %Upload{name: name}
) do
+ def filter(
%Upload{name: name} = upload
) do
extension = String.split(name, ".") |> List.last()
shasum = :crypto.hash(:sha256, File.read!(upload.tempfile)) |> Base.encode16(case: :lower)
filename = shasum <> "." <> extension
extension = String.split(name, ".") |> List.last()
shasum = :crypto.hash(:sha256, File.read!(upload.tempfile)) |> Base.encode16(case: :lower)
filename = shasum <> "." <> extension
diff --git
a/lib/pleroma/uploaders/s3.ex
b/lib/pleroma/uploaders/s3.ex
index fbd89616c5b1e7f462c7f75e143fe486973e8ea1..0038ba01fdc0104bf3f06df637be60ed985ddc12 100644
(file)
--- a/
lib/pleroma/uploaders/s3.ex
+++ b/
lib/pleroma/uploaders/s3.ex
@@
-27,7
+27,7
@@
defmodule Pleroma.Uploaders.S3 do
])}}
end
])}}
end
- def put_file(
upload = %Pleroma.Upload{}
) do
+ def put_file(
%Pleroma.Upload{} = upload
) do
config = Pleroma.Config.get([__MODULE__])
bucket = Keyword.get(config, :bucket)
config = Pleroma.Config.get([__MODULE__])
bucket = Keyword.get(config, :bucket)
diff --git
a/lib/pleroma/web/common_api/utils.ex
b/lib/pleroma/web/common_api/utils.ex
index 84be1d4a30ca04a5cd46b334451dc9eb46ac2325..be90b60bcdab7536c2b2ec91d792f18bc61e25c6 100644
(file)
--- a/
lib/pleroma/web/common_api/utils.ex
+++ b/
lib/pleroma/web/common_api/utils.ex
@@
-94,7
+94,7
@@
defmodule Pleroma.Web.CommonAPI.Utils do
def make_context(%Activity{data: %{"context" => context}}), do: context
def make_context(_), do: Utils.generate_context_id()
def make_context(%Activity{data: %{"context" => context}}), do: context
def make_context(_), do: Utils.generate_context_id()
- def maybe_add_attachments(text, _attachments,
_no_links = true
), do: text
+ def maybe_add_attachments(text, _attachments,
true = _no_links
), do: text
def maybe_add_attachments(text, attachments, _no_links) do
add_attachments(text, attachments)
def maybe_add_attachments(text, attachments, _no_links) do
add_attachments(text, attachments)