Generalize email domain handling in documentation and tests#27
Open
Generalize email domain handling in documentation and tests#27
Conversation
- Add .worktrees/ to .gitignore for git worktree support - Update _sanitize_email_for_username docstring to be domain-agnostic - Change CLAUDE.md example from trailofbits.com to example.com - Add tests for google.com, gmail.com, corporate, and plus addressing The code already supported any email domain; this updates docs and tests to reflect that capability. Co-Authored-By: Claude Opus 4.5 <[email protected]>
DarkaMaul
reviewed
Jan 30, 2026
dropkit/api.py
Outdated
| Sanitized username suitable for Linux user creation | ||
| """ | ||
| # Remove @trailofbits.com suffix (case insensitive) | ||
| # Remove @trailofbits.com suffix for backwards compatibility |
Collaborator
There was a problem hiding this comment.
I don't think that's needed because we just take the part before the @.
That could simply be a test instead
DarkaMaul
reviewed
Jan 30, 2026
| username = DigitalOceanAPI._sanitize_email_for_username("@trailofbits.com") | ||
| assert username == "user" | ||
|
|
||
| def test_sanitize_email_for_username_google(self): |
Collaborator
There was a problem hiding this comment.
I would add here the backtest for the @trailofbits.com usecase
DarkaMaul
reviewed
Jan 30, 2026
Collaborator
DarkaMaul
left a comment
There was a problem hiding this comment.
A few nitpick - but nice catch!
- Remove redundant trailofbits.com regex, simplify to split("@")[0]
- Rename test to clarify backwards compatibility intent
Co-Authored-By: Claude Opus 4.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.worktrees/to.gitignorefor git worktree support_sanitize_email_for_usernamedocstring to be domain-agnostictrailofbits.comtoexample.comThe code already supported any email domain; this updates docs and tests to reflect that capability.
Test plan
tests/test_api.pypassruff checkpassesty checkpassesprek run --all-filespasses🤖 Generated with Claude Code