-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
absorb database into common #40
base: master
Are you sure you want to change the base?
Conversation
…al-Mods/belethor into feature/basic-tag-editor
} | ||
|
||
@default %{ | ||
desc: "TODO, add a description" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
use Common.DataCase | ||
|
||
alias Common.TestUtils | ||
alias Common.ModDB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alias Common.ModDB
is not alphabetically ordered among its group.
describe "Mod" do | ||
|
||
defp get_mod!(id) do | ||
ModDB.get_mod!(id) |> Mod.preload() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pipe chain should start with a raw value.
apps/common/lib/common/moddb.ex
Outdated
@spec create_modlist(change :: Modlist.change) | ||
:: {:ok, Modlist.t} | {:error, Changeset.t(Modlist.t)} | ||
def create_modlist(change \\ %{}) do | ||
Modlist.new(change) |> Repo.insert() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pipe chain should start with a raw value.
apps/common/lib/common/schema/mod.ex
Outdated
:ok -> value | ||
f when is_function(f, 1) -> f.(value) | ||
end | ||
unless Map.has_key?(acc, clean_attr) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function body is nested too deep (max depth is 2, was 3).
Returns the list of _all_ modlists. | ||
""" | ||
@spec list_modlists() :: [Modlist.t] | ||
def list_modlists(), do: Repo.all(Modlist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use parentheses when defining a function which has no arguments.
published: false | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be no more than 1 consecutive blank lines.
apps/common/lib/common/schema/mod.ex
Outdated
def changeset(mod, changes \\ %{}) do | ||
fields = [:name, :desc, :published, :image] |> MapSet.new | ||
embeds = [:oldrim, :sse] |> MapSet.new | ||
affected = Map.keys(changes) |> MapSet.new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pipe chain should start with a raw value.
apps/common/lib/common/schema/mod.ex
Outdated
|
||
cs = Changeset.cast(mod, changes, MapSet.to_list(affected_fields)) | ||
|
||
cs = affected_embeds |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "cs" was declared more than once.
like ModTag, ModList, etc
apps/common/lib/common/schema/mod.ex
Outdated
) | ||
end | ||
|
||
# TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
) | ||
end | ||
|
||
def tag_change() do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use parentheses when defining a function which has no arguments.
apps/common/lib/common/schema/mod.ex
Outdated
published: false | ||
} | ||
|
||
@type tag_change :: [ {:add, ModTag.t()} | {:delete, ModTag.t()} ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no whitespace around parentheses/brackets most of the time, but here there is.
def changeset(mod, changes \\ %{}) do | ||
fields = [:name, :desc, :published, :image] |> MapSet.new() | ||
embeds = [:oldrim, :sse] |> MapSet.new() | ||
affected = Map.keys(changes) |> MapSet.new() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pipe chain should start with a raw value.
cs = Changeset.cast(mod, changes, MapSet.to_list(affected_fields)) | ||
|
||
# set the embeded fields | ||
cs = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable "cs" was declared more than once.
{:ok, Modlist.t()} | {:error, Changeset.t(Modlist.t())} | ||
def add_mod_to_list(list, mod) do | ||
_cs = Modlist.changeset(list) | ||
# TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
""" | ||
@spec list_modlists() :: [Modlist.t()] | ||
def list_modlists(), do: Repo.all(Modlist) | ||
# TODO needs paging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
""" | ||
@spec list_mods() :: [Mod.t()] | ||
def list_mods, do: Repo.all(Mod) | ||
# TODO page this stuff, Repo.stream/2 seems useful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
end | ||
|
||
test "Mod.changeset/2" do | ||
# TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO found
""" | ||
@spec list_modlists() :: [Modlist.t()] | ||
def list_modlists(), do: Repo.all(Modlist) | ||
# TODO needs paging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a TODO tag in a comment: # TODO needs paging
""" | ||
@spec list_mods() :: [Mod.t()] | ||
def list_mods, do: Repo.all(Mod) | ||
# TODO page this stuff, Repo.stream/2 seems useful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a TODO tag in a comment: # TODO page this stuff, Repo.stream/2 seems useful
SourceLevel has finished reviewing this Pull Request and has found:
|
was to lazy to make a new branch, just gonna continue working on it. till the tag editor stands roughly.