Skip to content

Commit

Permalink
function head before body warning fix
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen committed Feb 28, 2020
1 parent 9fd29a0 commit 04ff9c4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/crontab/date_checker.ex
Expand Up @@ -25,7 +25,10 @@ defmodule Crontab.DateChecker do
true
"""
@spec matches_date?(CronExpression.t(), NaiveDateTime.t()) :: boolean | no_return
@spec matches_date?(cron_expression :: CronExpression.t(), date :: NaiveDateTime.t()) ::
boolean | no_return
def matches_date?(cron_expression_or_condition_list, date)

def matches_date?(%CronExpression{reboot: true}, _),
do: raise("Special identifier @reboot is not supported.")

Expand All @@ -35,8 +38,10 @@ defmodule Crontab.DateChecker do
|> matches_date?(execution_date)
end

@spec matches_date?(CronExpression.condition_list(), NaiveDateTime.t()) :: boolean
def matches_date?(condition_list, date)
@spec matches_date?(
condition_list :: CronExpression.condition_list(),
date :: NaiveDateTime.t()
) :: boolean
def matches_date?([], _), do: true

def matches_date?([{interval, conditions} | tail], execution_date) do
Expand Down

0 comments on commit 04ff9c4

Please sign in to comment.