From 09fc6e8cb319b6505f3b0460ba1766d55b582d3e Mon Sep 17 00:00:00 2001 From: Caeden Perelli-Harris Date: Thu, 10 Aug 2023 15:14:21 +0100 Subject: [PATCH 1/2] Update strings/is_valid_email_address.py Co-authored-by: Tianyi Zheng --- strings/is_valid_email_address.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/is_valid_email_address.py b/strings/is_valid_email_address.py index fd1578a78..84abfa7ce 100644 --- a/strings/is_valid_email_address.py +++ b/strings/is_valid_email_address.py @@ -88,7 +88,7 @@ def is_valid_email_address(email: str) -> bool: ): return False - # (4.) Validate the placement of "." characters + # (4.) Validate the placement of "." characters in the local-part if ( local_part.startswith(".") or local_part.endswith(".") From bfd99cbc495ddcd81b56661f679752ba0c0e7f13 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 10 Aug 2023 14:14:55 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- strings/is_valid_email_address.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/strings/is_valid_email_address.py b/strings/is_valid_email_address.py index 84abfa7ce..a0653990f 100644 --- a/strings/is_valid_email_address.py +++ b/strings/is_valid_email_address.py @@ -31,7 +31,7 @@ email_tests: tuple[tuple[str, bool], ...] = ( False, ), ("i.like.underscores@but_its_not_allowed_in_this_part", False), - ("", False) + ("", False), ) # The maximum octets (one character as a standard unicode character is one byte) @@ -89,11 +89,7 @@ def is_valid_email_address(email: str) -> bool: return False # (4.) Validate the placement of "." characters in the local-part - if ( - local_part.startswith(".") - or local_part.endswith(".") - or ".." in local_part - ): + if local_part.startswith(".") or local_part.endswith(".") or ".." in local_part: return False # (5.) Validate the characters in the domain