Fix Credo code readability issues

This commit is contained in:
rustra
2020-01-28 20:15:59 +01:00
parent 97651e88e9
commit 3505736705
38 changed files with 63 additions and 58 deletions

View File

@@ -3,8 +3,7 @@ defmodule Mobilizon.Web.Email.Checker do
Provides a function to test emails against a "not so bad" regex.
"""
# TODO: simplify me!
@email_regex ~r/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
@email_regex ~r/^[\w.!#$%&*+\-\/=?\^`{|}~]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$/i
@doc """
Returns whether the email is valid.