Skip to content

Commit

Permalink
Started fixing linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MICHAELMUNAVU83 committed Nov 30, 2023
1 parent 8466c02 commit 5473e0a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 10 deletions.
7 changes: 3 additions & 4 deletions lib/elixir_conf_africa/cart.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule ElixirConfAfrica.Cart do
"""
def cart_list_ids(cart) do
cart |> Enum.map(fn cart_item -> cart_item.id end)
Enum.map(cart, fn cart_item -> cart_item.id end)
end

@doc """
Expand All @@ -21,8 +21,7 @@ defmodule ElixirConfAfrica.Cart do
"""

def increase_cart_item_quantity(cart_item, quantity) do
cart_item
|> Map.put(:quantity, quantity)
Map.put(cart_item, :quantity, quantity)
end

@doc """
Expand Down Expand Up @@ -68,7 +67,7 @@ defmodule ElixirConfAfrica.Cart do
"""
def add_quantity_to_cart_item(cart, cart_item, quantity) do
case cart |> Enum.filter(fn item -> item.id == cart_item.id end) do
case Enum.filter(cart, fn item -> item.id == cart_item.id end) do
[] ->
increase_cart_item_quantity(cart_item, quantity)

Expand Down
7 changes: 4 additions & 3 deletions lib/elixir_conf_africa_web.ex
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ defmodule ElixirConfAfricaWeb do
use Phoenix.Router, helpers: false

# Import common connection and controller functions to use in pipelines
import Plug.Conn

import Phoenix.Controller
import Phoenix.LiveView.Router
import Plug.Conn
end
end

Expand All @@ -42,8 +43,8 @@ defmodule ElixirConfAfricaWeb do
formats: [:html, :json],
layouts: [html: ElixirConfAfricaWeb.Layouts]

import Plug.Conn
import ElixirConfAfricaWeb.Gettext
import Plug.Conn

unquote(verified_routes())
end
Expand Down Expand Up @@ -82,10 +83,10 @@ defmodule ElixirConfAfricaWeb do
defp html_helpers do
quote do
# HTML escaping functionality
import Phoenix.HTML
# Core UI components and translation
import ElixirConfAfricaWeb.CoreComponents
import ElixirConfAfricaWeb.Gettext
import Phoenix.HTML

# Shortcut for generating JS commands
alias Phoenix.LiveView.JS
Expand Down
1 change: 1 addition & 0 deletions lib/elixir_conf_africa_web/live/event_live/index.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule ElixirConfAfricaWeb.EventLive.Index do
@moduledoc false
use ElixirConfAfricaWeb, :live_view

alias ElixirConfAfrica.Events
Expand Down
1 change: 1 addition & 0 deletions lib/elixir_conf_africa_web/live/event_live/show.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule ElixirConfAfricaWeb.EventLive.Show do
@moduledoc false
use ElixirConfAfricaWeb, :live_view

alias ElixirConfAfrica.Events
Expand Down
1 change: 1 addition & 0 deletions lib/elixir_conf_africa_web/live/ticket_type_live/show.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule ElixirConfAfricaWeb.TicketTypeLive.Show do
@moduledoc false
use ElixirConfAfricaWeb, :live_view

alias ElixirConfAfrica.TicketTypes
Expand Down
1 change: 1 addition & 0 deletions test/elixir_conf_africa/events_test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule ElixirConfAfrica.EventsTest do
@moduledoc false
use ElixirConfAfrica.DataCase

alias ElixirConfAfrica.Events
Expand Down
2 changes: 1 addition & 1 deletion test/elixir_conf_africa_web/live/home_live_test.exs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
defmodule ElixirConfAfricaWeb.HomeLiveTest do
use ElixirConfAfricaWeb.ConnCase

import Phoenix.LiveViewTest
import ElixirConfAfrica.Factory
import Phoenix.LiveViewTest

setup do
event = insert!(:elixir_conf_event)
Expand Down
4 changes: 2 additions & 2 deletions test/support/data_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ defmodule ElixirConfAfrica.DataCase do

using do
quote do
alias ElixirConfAfrica.Repo

import Ecto
import Ecto.Changeset
import Ecto.Query
import ElixirConfAfrica.DataCase

alias ElixirConfAfrica.Repo
end
end

Expand Down

0 comments on commit 5473e0a

Please sign in to comment.