style(repo): ruff fixes
Some checks failed
Actions / Build Documentation (MkDocs) (push) Successful in 42s
Actions / Lint Code (Ruff & Pylint) (push) Failing after 47s

This commit is contained in:
cswimr 2025-01-26 14:13:37 +00:00
parent 9df7f15bbe
commit ea5f51892a
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087
7 changed files with 39 additions and 38 deletions

View file

@ -151,7 +151,7 @@ async def retrieve_websocket_credentials(coginstance: Pterodactyl) -> Optional[d
Socket: %s
Token: %s...""",
websocket_credentials['data']['socket'],
websocket_credentials['data']['token'][:20]
websocket_credentials['data']['token'][:20],
)
return websocket_credentials
#NOTE - The token is truncated to prevent it from being logged in its entirety, for security reasons
@ -262,6 +262,5 @@ async def generate_achievement_embed(coginstance: Pterodactyl, username: str, ac
def mask_ip(string: str) -> str:
def check(match: re.Match[str]):
ip = match.group(0)
masked_ip = '.'.join(r'\*' * len(octet) for octet in ip.split('.'))
return masked_ip
return '.'.join(r'\*' * len(octet) for octet in ip.split('.'))
return re.sub(r'\b(?:\d{1,3}\.){3}\d{1,3}\b', check, string)