Skip to content

Commit

Permalink
make credo happy
Browse files Browse the repository at this point in the history
  • Loading branch information
electronicbites committed Dec 11, 2023
1 parent 09c4fe6 commit fba9b0f
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/radiator/accounts.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule Radiator.Accounts do
import Ecto.Query, warn: false
alias Radiator.Repo

alias Radiator.Accounts.{User, UserToken, UserNotifier}
alias Radiator.Accounts.{User, UserNotifier, UserToken}

## Database getters

Expand Down
3 changes: 3 additions & 0 deletions lib/radiator/accounts/user.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
defmodule Radiator.Accounts.User do
@moduledoc """
The user model.
"""
use Ecto.Schema
import Ecto.Changeset

Expand Down
3 changes: 3 additions & 0 deletions lib/radiator/accounts/user_notifier.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
defmodule Radiator.Accounts.UserNotifier do
@moduledoc """
Handles notification emails for users.
"""
import Swoosh.Email

alias Radiator.Mailer
Expand Down
3 changes: 3 additions & 0 deletions lib/radiator/accounts/user_token.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
defmodule Radiator.Accounts.UserToken do
@moduledoc """
Token handling for user sessions.
"""
use Ecto.Schema
import Ecto.Query
alias Radiator.Accounts.UserToken
Expand Down
1 change: 1 addition & 0 deletions lib/radiator/mailer.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
defmodule Radiator.Mailer do
@moduledoc false
use Swoosh.Mailer, otp_app: :radiator
end
4 changes: 1 addition & 3 deletions lib/radiator/outline.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ defmodule Radiator.Outline do
@moduledoc """
The Outline context.
"""

import Ecto.Query, warn: false
alias Radiator.Repo

alias Radiator.Outline.Node
alias Radiator.Repo

@doc """
Returns the list of nodes.
Expand Down
4 changes: 4 additions & 0 deletions lib/radiator/outline/node.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
defmodule Radiator.Outline.Node do
@moduledoc """
The node model which represents a single node in the outline.
Currenty there is no concept of a tree
"""
use Ecto.Schema
import Ecto.Changeset

Expand Down
4 changes: 3 additions & 1 deletion lib/radiator_web/components/core_components.ex
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ defmodule RadiatorWeb.CoreComponents do
"""
use Phoenix.Component

alias Phoenix.HTML.Form
alias Phoenix.LiveView.JS

import RadiatorWeb.Gettext

@doc """
Expand Down Expand Up @@ -303,7 +305,7 @@ defmodule RadiatorWeb.CoreComponents do
def input(%{type: "checkbox"} = assigns) do
assigns =
assign_new(assigns, :checked, fn ->
Phoenix.HTML.Form.normalize_value("checkbox", assigns[:value])
Form.normalize_value("checkbox", assigns[:value])
end)

~H"""
Expand Down
1 change: 1 addition & 0 deletions lib/radiator_web/components/layouts.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule RadiatorWeb.Layouts do
@moduledoc false
use RadiatorWeb, :html

embed_templates "layouts/*"
Expand Down
1 change: 1 addition & 0 deletions lib/radiator_web/telemetry.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule RadiatorWeb.Telemetry do
@moduledoc false
use Supervisor
import Telemetry.Metrics

Expand Down
3 changes: 3 additions & 0 deletions lib/radiator_web/user_auth.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
defmodule RadiatorWeb.UserAuth do
@moduledoc """
This module provides functions to log in and log out users.
"""
use RadiatorWeb, :verified_routes

import Plug.Conn
Expand Down
5 changes: 3 additions & 2 deletions test/support/data_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defmodule Radiator.DataCase do
"""

use ExUnit.CaseTemplate
alias Ecto.Adapters.SQL.Sandbox

using do
quote do
Expand All @@ -36,8 +37,8 @@ defmodule Radiator.DataCase do
Sets up the sandbox based on the test tags.
"""
def setup_sandbox(tags) do
pid = Ecto.Adapters.SQL.Sandbox.start_owner!(Radiator.Repo, shared: not tags[:async])
on_exit(fn -> Ecto.Adapters.SQL.Sandbox.stop_owner(pid) end)
pid = Sandbox.start_owner!(Radiator.Repo, shared: not tags[:async])
on_exit(fn -> Sandbox.stop_owner(pid) end)
end

@doc """
Expand Down

0 comments on commit fba9b0f

Please sign in to comment.