summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2024-05-31 07:19:48 +0200
committerMark Felder <feld@feld.me>2024-06-12 15:18:47 -0400
commitcb91dab75f70ade96028c32e270a27352c41714e (patch)
tree00179c26c4cf1a614edad69d71b9f4a7c53a81f8 /lib
parentf47a1246985d6ce69ceca4104e43f630f1f33610 (diff)
downloadpleroma-cb91dab75f70ade96028c32e270a27352c41714e.tar.gz
pleroma-cb91dab75f70ade96028c32e270a27352c41714e.zip
Switch formatting checks to Elixir 1.15
Diffstat (limited to 'lib')
-rw-r--r--lib/mix/tasks/pleroma/database.ex2
-rw-r--r--lib/pleroma/emoji/pack.ex6
-rw-r--r--lib/pleroma/object/updater.ex5
-rw-r--r--lib/pleroma/user/backup.ex12
-rw-r--r--lib/pleroma/web/api_spec/operations/search_operation.ex4
-rw-r--r--lib/pleroma/web/auth/ldap_authenticator.ex2
-rw-r--r--lib/pleroma/web/mastodon_api/websocket_handler.ex2
-rw-r--r--lib/pleroma/web/plugs/o_auth_scopes_plug.ex4
-rw-r--r--lib/pleroma/web/xml.ex2
9 files changed, 23 insertions, 16 deletions
diff --git a/lib/mix/tasks/pleroma/database.ex b/lib/mix/tasks/pleroma/database.ex
index 13ac6536c..b82d1f079 100644
--- a/lib/mix/tasks/pleroma/database.ex
+++ b/lib/mix/tasks/pleroma/database.ex
@@ -351,7 +351,7 @@ defmodule Mix.Tasks.Pleroma.Database do
)
end
- shell_info('Done.')
+ shell_info(~c"Done.")
end
end
diff --git a/lib/pleroma/emoji/pack.ex b/lib/pleroma/emoji/pack.ex
index afc341853..785fdb8b2 100644
--- a/lib/pleroma/emoji/pack.ex
+++ b/lib/pleroma/emoji/pack.ex
@@ -416,10 +416,10 @@ defmodule Pleroma.Emoji.Pack do
end
defp create_archive_and_cache(pack, hash) do
- files = ['pack.json' | Enum.map(pack.files, fn {_, file} -> to_charlist(file) end)]
+ files = [~c"pack.json" | Enum.map(pack.files, fn {_, file} -> to_charlist(file) end)]
{:ok, {_, result}} =
- :zip.zip('#{pack.name}.zip', files, [:memory, cwd: to_charlist(pack.path)])
+ :zip.zip(~c"#{pack.name}.zip", files, [:memory, cwd: to_charlist(pack.path)])
ttl_per_file = Pleroma.Config.get!([:emoji, :shared_pack_cache_seconds_per_file])
overall_ttl = :timer.seconds(ttl_per_file * Enum.count(files))
@@ -586,7 +586,7 @@ defmodule Pleroma.Emoji.Pack do
with :ok <- File.mkdir_p!(local_pack.path) do
files = Enum.map(remote_pack["files"], fn {_, path} -> to_charlist(path) end)
# Fallback cannot contain a pack.json file
- files = if pack_info[:fallback], do: files, else: ['pack.json' | files]
+ files = if pack_info[:fallback], do: files, else: [~c"pack.json" | files]
:zip.unzip(archive, cwd: to_charlist(local_pack.path), file_list: files)
end
diff --git a/lib/pleroma/object/updater.ex b/lib/pleroma/object/updater.ex
index b1e4870ba..b80bc7faf 100644
--- a/lib/pleroma/object/updater.ex
+++ b/lib/pleroma/object/updater.ex
@@ -134,7 +134,10 @@ defmodule Pleroma.Object.Updater do
else
%{updated_object: updated_data} =
updated_data
- |> maybe_update_history(original_data, updated: updated, use_history_in_new_object?: false)
+ |> maybe_update_history(original_data,
+ updated: updated,
+ use_history_in_new_object?: false
+ )
updated_data
|> Map.put("updated", date)
diff --git a/lib/pleroma/user/backup.ex b/lib/pleroma/user/backup.ex
index 65e0baccd..1821de667 100644
--- a/lib/pleroma/user/backup.ex
+++ b/lib/pleroma/user/backup.ex
@@ -197,12 +197,12 @@ defmodule Pleroma.User.Backup do
end
@files [
- 'actor.json',
- 'outbox.json',
- 'likes.json',
- 'bookmarks.json',
- 'followers.json',
- 'following.json'
+ ~c"actor.json",
+ ~c"outbox.json",
+ ~c"likes.json",
+ ~c"bookmarks.json",
+ ~c"followers.json",
+ ~c"following.json"
]
@spec export(Pleroma.User.Backup.t(), pid()) :: {:ok, String.t()} | :error
def export(%__MODULE__{} = backup, caller_pid) do
diff --git a/lib/pleroma/web/api_spec/operations/search_operation.ex b/lib/pleroma/web/api_spec/operations/search_operation.ex
index 539743ba3..c2afe8e18 100644
--- a/lib/pleroma/web/api_spec/operations/search_operation.ex
+++ b/lib/pleroma/web/api_spec/operations/search_operation.ex
@@ -79,7 +79,9 @@ defmodule Pleroma.Web.ApiSpec.SearchOperation do
%Schema{type: :string, enum: ["accounts", "hashtags", "statuses"]},
"Search type"
),
- Operation.parameter(:q, :query, %Schema{type: :string}, "The search query", required: true),
+ Operation.parameter(:q, :query, %Schema{type: :string}, "The search query",
+ required: true
+ ),
Operation.parameter(
:resolve,
:query,
diff --git a/lib/pleroma/web/auth/ldap_authenticator.ex b/lib/pleroma/web/auth/ldap_authenticator.ex
index e8cd4491c..17ffd820d 100644
--- a/lib/pleroma/web/auth/ldap_authenticator.ex
+++ b/lib/pleroma/web/auth/ldap_authenticator.ex
@@ -110,7 +110,7 @@ defmodule Pleroma.Web.Auth.LDAPAuthenticator do
}
params =
- case List.keyfind(attributes, 'mail', 0) do
+ case List.keyfind(attributes, ~c"mail", 0) do
{_, [mail]} -> Map.put_new(params, :email, :erlang.list_to_binary(mail))
_ -> params
end
diff --git a/lib/pleroma/web/mastodon_api/websocket_handler.ex b/lib/pleroma/web/mastodon_api/websocket_handler.ex
index bb27d806d..730295a4c 100644
--- a/lib/pleroma/web/mastodon_api/websocket_handler.ex
+++ b/lib/pleroma/web/mastodon_api/websocket_handler.ex
@@ -104,7 +104,7 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
end
def handle_info(:close, state) do
- {:stop, {:closed, 'connection closed by server'}, state}
+ {:stop, {:closed, ~c"connection closed by server"}, state}
end
def handle_info(msg, state) do
diff --git a/lib/pleroma/web/plugs/o_auth_scopes_plug.ex b/lib/pleroma/web/plugs/o_auth_scopes_plug.ex
index faf0fd8c6..08c2f61ea 100644
--- a/lib/pleroma/web/plugs/o_auth_scopes_plug.ex
+++ b/lib/pleroma/web/plugs/o_auth_scopes_plug.ex
@@ -34,7 +34,9 @@ defmodule Pleroma.Web.Plugs.OAuthScopesPlug do
permissions = Enum.join(missing_scopes, " #{op} ")
error_message =
- dgettext("errors", "Insufficient permissions: %{permissions}.", permissions: permissions)
+ dgettext("errors", "Insufficient permissions: %{permissions}.",
+ permissions: permissions
+ )
conn
|> put_resp_content_type("application/json")
diff --git a/lib/pleroma/web/xml.ex b/lib/pleroma/web/xml.ex
index 64329e4ba..3997e1661 100644
--- a/lib/pleroma/web/xml.ex
+++ b/lib/pleroma/web/xml.ex
@@ -9,7 +9,7 @@ defmodule Pleroma.Web.XML do
def string_from_xpath(xpath, doc) do
try do
- {:xmlObj, :string, res} = :xmerl_xpath.string('string(#{xpath})', doc)
+ {:xmlObj, :string, res} = :xmerl_xpath.string(~c"string(#{xpath})", doc)
res =
res