mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
Fix some Credo warnings
This commit is contained in:
parent
a080e89a35
commit
e88545de0c
@ -1,4 +1,6 @@
|
||||
defmodule Chess do
|
||||
@moduledoc false
|
||||
|
||||
use Application
|
||||
|
||||
# See http://elixir-lang.org/docs/stable/elixir/Application.html
|
||||
|
||||
@ -105,10 +105,11 @@ defmodule Chess.Auth do
|
||||
|
||||
@doc false
|
||||
def authenticate_user(username, password) do
|
||||
Repo.one(
|
||||
from u in User,
|
||||
where: u.username == ^username
|
||||
)
|
||||
query = from u in User,
|
||||
where: u.username == ^username
|
||||
|
||||
query
|
||||
|> Repo.one
|
||||
|> Argon2.check_pass(password)
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
defmodule Chess.Auth.Guardian do
|
||||
@moduledoc false
|
||||
|
||||
use Guardian, otp_app: :chess
|
||||
|
||||
alias Chess.Auth
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
defmodule Chess.Board do
|
||||
@moduledoc false
|
||||
|
||||
def output(board) do
|
||||
Enum.map(0..7, fn (rank) ->
|
||||
Enum.map(0..7, fn (file) ->
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
defmodule Chess.Store.Game do
|
||||
@moduledoc false
|
||||
|
||||
use Ecto.Schema
|
||||
use Timex.Ecto.Timestamps
|
||||
|
||||
|
||||
@ -5,10 +5,12 @@ defmodule ChessWeb.GameController do
|
||||
|
||||
def index(conn, _params) do
|
||||
changeset = Game.changeset(%Game{})
|
||||
games = Game
|
||||
|> Game.for_user(current_user(conn))
|
||||
|> Game.ordered
|
||||
|> Repo.all
|
||||
games =
|
||||
Game
|
||||
|> Game.for_user(current_user(conn))
|
||||
|> Game.ordered
|
||||
|> Repo.all
|
||||
|
||||
render(conn, "index.html", games: games, changeset: changeset)
|
||||
end
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user