Skip to content

Commit

Permalink
Remove all whitespace around email, both leading and trailing
Browse files Browse the repository at this point in the history
  • Loading branch information
jfly committed Oct 30, 2024
1 parent 7552c3d commit 2077761
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ def main(id: str, email: str, force: bool) -> None:
)

# Make sure we aren't being given a text file that happens to have a newline at the end.
if email.endswith("\n"):
click.secho("Removing trailing newline from email address", fg="yellow")
email = email.removesuffix("\n")
clean_email = email.strip()
if clean_email != email:
click.secho("Removed whitespace surrounding given email address", fg="yellow")
email = clean_email

if Path.cwd().name != "non-critical-infra":
raise click.ClickException(
Expand Down

0 comments on commit 2077761

Please sign in to comment.