-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cases output in fun cog. #1457
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good & works well, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see that pretty much all the functionalities are there, well done! I have a few comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and works well, just a few trivial comments.
cleaned_text, embed = await self._clean_text(ctx, text, conversion_func) | ||
await ctx.send(content=cleaned_text, embed=embed) | ||
|
||
@commands.command(name="screamingsnakecase", aliases=("screamsnake", "ssnake", "screamingsnake",)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@commands.command(name="screamingsnakecase", aliases=("screamsnake", "ssnake", "screamingsnake",)) | |
@commands.command(name="screamingsnakecase", aliases=("screamsnake", "ssnake", "screamingsnake", "sscase")) |
How about having a*case
alias for all our case commands? It made sense to me during testing and was surprised it wasn't already added 😄
def neutralise_string(txt: str | None) -> list[str] | None: | ||
"""Attempts to neutralise all punctuation and cases and returns a string of lowercase words.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring would have to be updated to reflect the new function. Maybe the name too, up to you.
def neutralise_string(txt: str | None) -> list[str] | None: | |
"""Attempts to neutralise all punctuation and cases and returns a string of lowercase words.""" | |
def split_words(txt: str | None) -> list[str] | None: | |
"""Neutralise all punctuation and cases and return a list of separated words.""" |
text = helpers.neutralise_string(text) | ||
return "_".join( | ||
text | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider making the variable name of the returned value more meaningful since the helper function was updated, and it's not immediately obvious that the text
is actually a list
here.
text = helpers.neutralise_string(text) | |
return "_".join( | |
text | |
) | |
words = helpers.neutralise_string(text) | |
return "_".join(words) |
Note that this also applies to the conversion_func
for other case commands :)
@JelmerKorten Hello! Will you be able to finish up this PR? Thanks! |
Howzit!
I can definitely try.
To be very honest, I thought it was finished and accepted a long time ago.
Tried to use it on the server a few weeks back and it didn’t work.
I’ll get to it probably at the end of next week.
Thanks for the reminder!
…On Fri, 5 Jul 2024 at 04:07, Xithrius ***@***.***> wrote:
@JelmerKorten <https://github.com/JelmerKorten> Hello! Will you be able
to finish up this PR? Thanks!
—
Reply to this email directly, view it on GitHub
<#1457 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ASFCDLYA5GQPLVNIGW54QATZKXPUXAVCNFSM6AAAAABDMOOVYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGY2TIOJYHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks for the quick response! No rush. If you need any help completing this PR, don't hesitate to ask. |
Closes #707 if approved.
(new PR because of branch)
Description
PascalCase, camelCase, snake_case, SCREAMING_SNAKE_CASE
.pascalcase aliases [.pascal .pcase]
.camelcase aliases [.camel .ccase]
.snakecase alias [.scase]
.screamingsnakecase aliases [.screamsnake .ssnake .screamingsnake]
Did you: