Skip to content

Commit 2725fa7

Browse files
committed
mix fmt
1 parent 53100f3 commit 2725fa7

35 files changed

+74
-69
lines changed

lib/algora/accounts/accounts.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -862,7 +862,7 @@ defmodule Algora.Accounts do
862862
end
863863

864864
def admins_last_active do
865-
Algora.Repo.one(
865+
Repo.one(
866866
from u in User,
867867
where: u.is_admin == true,
868868
order_by: [desc: u.last_active_at],

lib/algora/accounts/schemas/user.ex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,21 +124,21 @@ defmodule Algora.Accounts.User do
124124
field :open_to_remote, :boolean, default: false
125125
field :open_to_hybrid, :boolean, default: false
126126
field :open_to_onsite, :boolean, default: false
127-
127+
128128
# Relocation preferences
129129
field :open_to_relocate_sf, :boolean, default: false
130130
field :open_to_relocate_ny, :boolean, default: false
131131
field :open_to_relocate_country, :boolean, default: false
132132
field :open_to_relocate_world, :boolean, default: false
133-
133+
134134
# Commitment preferences
135135
field :open_to_fulltime, :boolean, default: false
136136
field :open_to_contract, :boolean, default: false
137-
137+
138138
# Track preferences
139139
field :open_to_ic, :boolean, default: false
140140
field :open_to_manager, :boolean, default: false
141-
141+
142142
# Work authorization
143143
field :work_auth_us, :boolean, default: false
144144
field :work_auth_eu, :boolean, default: false
@@ -408,7 +408,7 @@ defmodule Algora.Accounts.User do
408408
bio: meta["bio"],
409409
location: meta["location"],
410410
avatar_url: meta["avatar_url"],
411-
website_url: Algora.Util.normalize_url(meta["blog"]),
411+
website_url: Util.normalize_url(meta["blog"]),
412412
github_url: meta["html_url"],
413413
domain: get_domain(meta)
414414
}

lib/algora/activities/activities.ex

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ defmodule Algora.Activities do
1717

1818
@schema_from_table %{
1919
identity_activities: Identity,
20-
user_activities: Algora.Accounts.User,
20+
user_activities: User,
2121
attempt_activities: Algora.Bounties.Attempt,
2222
bonus_activities: Algora.Bounties.Bonus,
2323
bounty_activities: Bounty,
@@ -163,12 +163,12 @@ defmodule Algora.Activities do
163163
def insert(target, activity) do
164164
target
165165
|> Activity.build_activity(activity)
166-
|> Algora.Repo.insert()
166+
|> Repo.insert()
167167
end
168168

169169
def all_with_assoc(query) do
170170
activities = Repo.all(query)
171-
source = Dataloader.Ecto.new(Algora.Repo)
171+
source = Dataloader.Ecto.new(Repo)
172172
dataloader = Dataloader.add_source(Dataloader.new(), :db, source)
173173

174174
loader =
@@ -214,7 +214,7 @@ defmodule Algora.Activities do
214214
updated_at: a.updated_at
215215
}
216216

217-
struct(Activity, Algora.Repo.one(query))
217+
struct(Activity, Repo.one(query))
218218
end
219219

220220
def get_with_preloaded_assoc(table, id) do
@@ -234,7 +234,7 @@ defmodule Algora.Activities do
234234
from a in schema, where: a.id == ^assoc_id
235235
end
236236

237-
Algora.Repo.one(query)
237+
Repo.one(query)
238238
end
239239

240240
def assoc_url(table, id) do
@@ -264,12 +264,12 @@ defmodule Algora.Activities do
264264
:ok = Phoenix.PubSub.broadcast(Algora.PubSub, "activity:table:#{activity.assoc_name}", activity)
265265

266266
users_query =
267-
from u in Algora.Accounts.User,
267+
from u in User,
268268
where: u.id in ^user_ids,
269269
select: u
270270

271271
users_query
272-
|> Algora.Repo.all()
272+
|> Repo.all()
273273
|> Enum.reduce([], fn user, not_online ->
274274
# TODO setup notification preferences
275275
:ok = Phoenix.PubSub.broadcast(Algora.PubSub, "activity:users:#{user.id}", activity)
@@ -309,7 +309,7 @@ defmodule Algora.Activities do
309309
discord_job =
310310
if discord_payload = DiscordViews.render(activity) do
311311
[
312-
Algora.Activities.SendDiscord.changeset(%{
312+
SendDiscord.changeset(%{
313313
url: Algora.config([:discord, :webhook_url]),
314314
payload: discord_payload
315315
})

lib/algora/contracts/contracts.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ defmodule Algora.Contracts do
4141
def create_contract(attrs) do
4242
case %Contract{} |> Contract.changeset(attrs) |> Repo.insert() do
4343
{:ok, contract} ->
44-
Algora.Activities.alert("Contract created: #{contract.id}", :info)
44+
Activities.alert("Contract created: #{contract.id}", :info)
4545
{:ok, contract}
4646

4747
{:error, error} ->
48-
Algora.Activities.alert("Error creating contract: #{inspect(error)}", :error)
48+
Activities.alert("Error creating contract: #{inspect(error)}", :error)
4949
{:error, error}
5050
end
5151
end

lib/algora/integrations/crawler.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ defmodule Algora.Crawler do
88
@headers [{"User-Agent", @user_agent}]
99
@max_redirects 5
1010
@max_retries 3
11-
@retry_delay :timer.seconds(1)
11+
@retry_delay to_timeout(second: 1)
1212
@blacklist_filename "domain_blacklist.txt"
1313

1414
def blacklisted?(domain) do

lib/algora/integrations/github/behaviour.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ defmodule Algora.Github.Behaviour do
3636
@callback create_label(token(), String.t(), String.t(), map()) :: {:ok, map()} | {:error, String.t()}
3737
@callback get_label(token(), String.t(), String.t(), String.t()) :: {:ok, map()} | {:error, String.t()}
3838
@callback remove_label(token(), String.t(), String.t(), String.t()) :: {:ok, map()} | {:error, String.t()}
39-
@callback remove_label_from_issue(token(), String.t(), String.t(), integer(), String.t()) :: {:ok, map()} | {:error, String.t()}
39+
@callback remove_label_from_issue(token(), String.t(), String.t(), integer(), String.t()) ::
40+
{:ok, map()} | {:error, String.t()}
4041
end

lib/algora/integrations/github/github.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,6 @@ defmodule Algora.Github do
162162
def remove_label(token, owner, repo, label), do: client().remove_label(token, owner, repo, label)
163163

164164
@impl true
165-
def remove_label_from_issue(token, owner, repo, number, label), do: client().remove_label_from_issue(token, owner, repo, number, label)
165+
def remove_label_from_issue(token, owner, repo, number, label),
166+
do: client().remove_label_from_issue(token, owner, repo, number, label)
166167
end

lib/algora/integrations/github/poller/deliveries.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defmodule Algora.Github.Poller.Deliveries do
1111
require Logger
1212

1313
@per_page 100
14-
@poll_interval :timer.seconds(10)
14+
@poll_interval to_timeout(second: 10)
1515

1616
# Client API
1717
def start_link(opts) do

lib/algora/integrations/github/poller/search.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defmodule Algora.Github.Poller.Search do
1616
require Logger
1717

1818
@per_page 10
19-
@poll_interval :timer.seconds(3)
19+
@poll_interval to_timeout(second: 3)
2020

2121
# Client API
2222
def start_link(opts) do

lib/algora/integrations/github/stargazer.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule Algora.Stargazer do
77

88
require Logger
99

10-
@poll_interval :timer.minutes(10)
10+
@poll_interval to_timeout(minute: 10)
1111

1212
def start_link(cmd) do
1313
GenServer.start_link(__MODULE__, cmd, name: __MODULE__)

0 commit comments

Comments
 (0)