Skip to content

Commit

Permalink
cleanup(Credo): Remove parentheses from functions with no arguments (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kotva006 authored Jun 12, 2024
1 parent f6f8081 commit 6df9331
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lib/alerts/cache/bus_stop_change_s3.ex
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ defmodule Alerts.Cache.BusStopChangeS3 do
end)
end

defp bucket_prefix() do
defp bucket_prefix do
Application.fetch_env!(:dotcom, :alerts_bus_stop_change_bucket)
end
end
2 changes: 1 addition & 1 deletion lib/algolia/query.ex
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule Algolia.Query do
alias Algolia.Query.Request

@doc "Algolia indexes available to query"
def valid_indexes() do
def valid_indexes do
suffix = Application.get_env(:dotcom, :algolia_index_suffix, "")
["routes", "stops", "drupal"] |> Enum.map(&{String.to_atom(&1), &1 <> suffix})
end
Expand Down
4 changes: 2 additions & 2 deletions lib/cms/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ defmodule CMS.Repo do
on_error: :nothing,
opts: [ttl: @ttl]
)
def whats_happening() do
def whats_happening do
case @cms_api.view("/cms/whats-happening", []) do
{:ok, api_data} -> Enum.map(api_data, &WhatsHappeningItem.from_api/1)
_ -> []
Expand All @@ -127,7 +127,7 @@ defmodule CMS.Repo do
on_error: :nothing,
opts: [ttl: @ttl]
)
def do_banner() do
def do_banner do
case @cms_api.view("/cms/important-notices", []) do
{:ok, [api_data | _]} -> Banner.from_api(api_data)
{:ok, _} -> :empty
Expand Down
4 changes: 2 additions & 2 deletions lib/dotcom_web/controllers/bus_stop_change_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ defmodule DotcomWeb.BusStopChangeController do

# These are %HistoricalAlert{} structs that we store in AWS S3.
# In the future all of our past alerts will come from here.
defp past_stored_alerts() do
defp past_stored_alerts do
yesterday = Util.service_date() |> Timex.shift(days: -1)

BusStopChangeS3.get_stored_alerts()
Expand All @@ -67,7 +67,7 @@ defmodule DotcomWeb.BusStopChangeController do
# These are alerts exported from the Alerts UI application into
# a series of CSV files. These will eventually be phased out in favor
# of the alerts we store in S3.
defp get_old_alerts() do
defp get_old_alerts do
folder = Application.app_dir(:dotcom) |> Path.join("priv/bus-stop-change")

case File.ls(folder) do
Expand Down
4 changes: 2 additions & 2 deletions lib/dotcom_web/controllers/customer_support_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,8 @@ defmodule DotcomWeb.CustomerSupportController do
})
end

@spec get_options_per_mode() :: map
def get_options_per_mode() do
@spec get_options_per_mode :: map
def get_options_per_mode do
bus_ferry_cr_options =
for route_type <- 2..4, into: %{} do
options =
Expand Down
2 changes: 1 addition & 1 deletion lib/dotcom_web/controllers/places_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ defmodule DotcomWeb.PlacesController do
end
end

defp popular_locations() do
defp popular_locations do
# copied from TripPlannerLocControls.POPULAR
[
%{
Expand Down
2 changes: 1 addition & 1 deletion lib/dotcom_web/stats.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defmodule DotcomWeb.Stats do
Resets the Agent state after dispatching the stats.
"""
def dispatch_stats() do
def dispatch_stats do
Enum.each(Agent.get(__MODULE__, & &1), &dispatch_method/1)

Agent.update(__MODULE__, fn _ -> %{} end)
Expand Down
4 changes: 2 additions & 2 deletions lib/dotcom_web/views/customer_support_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ defmodule DotcomWeb.CustomerSupportView do
end
end

@spec get_all_modes() :: list
def get_all_modes() do
@spec get_all_modes :: list
def get_all_modes do
# get options for subway, bus, commuter rail and ferry:
subway_bus_cr_ferry_opts =
Enum.map(1..4, fn mode ->
Expand Down
4 changes: 2 additions & 2 deletions lib/dotcom_web/views/page_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ defmodule DotcomWeb.PageView do
)
end

@spec alerts_access_url() :: String.t()
defp alerts_access_url() do
@spec alerts_access_url :: String.t()
defp alerts_access_url do
DotcomWeb.Router.Helpers.alert_url(
DotcomWeb.Endpoint,
:show,
Expand Down
4 changes: 2 additions & 2 deletions lib/green_line.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule GreenLine do
@doc """
Terminal stops for each Green Line branch and direction.
"""
def termini_stops() do
def termini_stops do
for direction_id <- [0, 1], branch_id <- GreenLine.branch_ids(), into: %{} do
stop = @stops_repo.by_route(branch_id, direction_id) |> List.last()
{{branch_id, direction_id}, stop}
Expand Down Expand Up @@ -90,7 +90,7 @@ defmodule GreenLine do
All the branch IDs of the Green Line.
"""
@spec branch_ids() :: [branch_name]
def branch_ids() do
def branch_ids do
~w(Green-B Green-C Green-D Green-E)s
end

Expand Down
2 changes: 1 addition & 1 deletion lib/mix/tasks/header_footer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ if Mix.env() in [:dev, :test] do
close_session(session)
end

defp new_session() do
defp new_session do
{:ok, session} =
Wallaby.start_session(
readiness_timeout: 60_000,
Expand Down
2 changes: 1 addition & 1 deletion lib/predictions/store.ex
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ defmodule Predictions.Store do
}
end

defp periodic_delete() do
defp periodic_delete do
Process.send_after(self(), :periodic_delete, 300_000)
end
end
2 changes: 1 addition & 1 deletion lib/req/stats.ex
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ defmodule Req.Stats do
Resets the Agent state after dispatching the stats.
"""
def dispatch_stats() do
def dispatch_stats do
Enum.each(Agent.get(__MODULE__, & &1), &dispatch_host/1)

Agent.update(__MODULE__, fn _ -> %{} end)
Expand Down
2 changes: 1 addition & 1 deletion lib/routes/mock_repo_api.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Routes.MockRepoApi do
@behaviour Routes.RepoApi

@impl Routes.RepoApi
def all() do
def all do
[
get("Red"),
%Routes.Route{
Expand Down
2 changes: 1 addition & 1 deletion test/predictions/predictions_pub_sub_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ defmodule Predictions.PredictionsPubSubTest do
end
end

defp count_workers() do
defp count_workers do
Supervisor.count_children(Predictions.StreamSupervisor)
|> Map.get(:active)
end
Expand Down
2 changes: 1 addition & 1 deletion test/support/conn_case.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule DotcomWeb.ConnCase do

use ExUnit.CaseTemplate

def default_conn() do
def default_conn do
%Plug.Conn{
Phoenix.ConnTest.build_conn()
| host: "localhost"
Expand Down

0 comments on commit 6df9331

Please sign in to comment.