aboutsummaryrefslogtreecommitdiff
path: root/lib/ejabberd/config
diff options
context:
space:
mode:
authorMickael Remond <mremond@process-one.net>2018-12-26 17:32:39 +0100
committerMickael Remond <mremond@process-one.net>2018-12-26 17:32:39 +0100
commit749fa95011718f67976a4ac201f448b09e6cbeeb (patch)
tree99ea5d16f43f86eed43c0283d255d0c177e60eaf /lib/ejabberd/config
parentUpdate ejabberd version for mix (diff)
Remove most Elixir warnings
Diffstat (limited to 'lib/ejabberd/config')
-rw-r--r--lib/ejabberd/config/config.ex4
-rw-r--r--lib/ejabberd/config/ejabberd_module.ex1
-rw-r--r--lib/ejabberd/config/logger/ejabberd_logger.ex2
-rw-r--r--lib/ejabberd/config/validator/validation.ex2
-rw-r--r--lib/ejabberd/config/validator/validator_attrs.ex2
5 files changed, 4 insertions, 7 deletions
diff --git a/lib/ejabberd/config/config.ex b/lib/ejabberd/config/config.ex
index 4d1270bc1..4d1728d16 100644
--- a/lib/ejabberd/config/config.ex
+++ b/lib/ejabberd/config/config.ex
@@ -23,7 +23,7 @@ defmodule Ejabberd.Config do
# Could be also possible to interrupt the compilation&execution by throwing
# an exception if necessary.
def __before_compile__(_env) do
- get_modules_parsed_in_order
+ get_modules_parsed_in_order()
|> EjabberdModule.validate
|> EjabberdLogger.log_errors
end
@@ -48,7 +48,7 @@ defmodule Ejabberd.Config do
Returns a list with all the opts, formatted for ejabberd.
"""
def get_ejabberd_opts do
- get_general_opts
+ get_general_opts()
|> Dict.put(:modules, get_modules_parsed_in_order())
|> Dict.put(:listeners, get_listeners_parsed_in_order())
|> Ejabberd.Config.OptsFormatter.format_opts_for_ejabberd
diff --git a/lib/ejabberd/config/ejabberd_module.ex b/lib/ejabberd/config/ejabberd_module.ex
index 4de9a302e..6a74fe460 100644
--- a/lib/ejabberd/config/ejabberd_module.ex
+++ b/lib/ejabberd/config/ejabberd_module.ex
@@ -12,7 +12,6 @@ defmodule Ejabberd.Config.EjabberdModule do
defstruct [:module, :attrs]
alias Ejabberd.Config.EjabberdModule
- alias Ejabberd.Config.Attr
alias Ejabberd.Config.Validation
@doc """
diff --git a/lib/ejabberd/config/logger/ejabberd_logger.ex b/lib/ejabberd/config/logger/ejabberd_logger.ex
index 270fbfaa6..90970ba73 100644
--- a/lib/ejabberd/config/logger/ejabberd_logger.ex
+++ b/lib/ejabberd/config/logger/ejabberd_logger.ex
@@ -21,7 +21,7 @@ defmodule Ejabberd.Config.EjabberdLogger do
defp do_log_errors({:attribute, errors}), do: Enum.each errors, &log_attribute_error/1
defp do_log_errors({:dependency, errors}), do: Enum.each errors, &log_dependency_error/1
- defp log_attribute_error({{attr_name, val}, :attr_not_supported}), do:
+ defp log_attribute_error({{attr_name, _val}, :attr_not_supported}), do:
IO.puts "[ WARN ] Annotation @#{attr_name} is not supported."
defp log_attribute_error({{attr_name, val}, :type_not_supported}), do:
diff --git a/lib/ejabberd/config/validator/validation.ex b/lib/ejabberd/config/validator/validation.ex
index 2fe00361a..af582676e 100644
--- a/lib/ejabberd/config/validator/validation.ex
+++ b/lib/ejabberd/config/validator/validation.ex
@@ -7,9 +7,7 @@ defmodule Ejabberd.Config.Validation do
@type mod_validation_result :: {:ok, EjabberdModule.t} | {:error, EjabberdModule.t, map}
alias Ejabberd.Config.EjabberdModule
- alias Ejabberd.Config.Attr
alias Ejabberd.Config.Validator
- alias Ejabberd.Config.ValidatorUtility
@doc """
Given a module or a list of modules it runs validators on them
diff --git a/lib/ejabberd/config/validator/validator_attrs.ex b/lib/ejabberd/config/validator/validator_attrs.ex
index 94117ab21..6a85c068d 100644
--- a/lib/ejabberd/config/validator/validator_attrs.ex
+++ b/lib/ejabberd/config/validator/validator_attrs.ex
@@ -18,7 +18,7 @@ defmodule Ejabberd.Config.Validator.Attrs do
def validate({modules, mod, errors}) do
errors = Enum.reduce mod.attrs, errors, fn(attr, err) ->
case Attr.validate(attr) do
- {:ok, attr} -> err
+ {:ok, _attr} -> err
{:error, attr, cause} -> put_error(err, :attribute, {attr, cause})
end
end