Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add header, hyperlink and subtext utilities (#6102) #19

Merged

Conversation

BenCos17
Copy link
Member

@BenCos17 BenCos17 commented Sep 1, 2024

Description of the changes

Have the changes in this PR been tested?

Yes

Summary by Sourcery

Add new utility functions header, hyperlink, and subtext to enhance text formatting capabilities in the chat formatting module.

New Features:

  • Introduce a hyperlink utility function to create hyperlink markdown with specified text and URL.
  • Add a header utility function to format text as a header with specified sizes: small, medium, or large.
  • Implement a subtext utility function to format text as subtext.

Co-authored-by: Kowlin <10947836+Kowlin@users.noreply.github.com>
Copy link

sourcery-ai bot commented Sep 1, 2024

Reviewer's Guide by Sourcery

This pull request adds three new utility functions to the chat_formatting.py file: hyperlink, header, and subtext. These functions provide markdown formatting capabilities for creating hyperlinks, headers of different sizes, and subtext.

File-Level Changes

Change Details Files
Added new utility functions for markdown formatting
  • Implemented hyperlink function to create markdown links
  • Added header function to format text as headers with different sizes
  • Created subtext function to format text as subtext
  • Updated the __all__ list to include the new functions
redbot/core/utils/chat_formatting.py

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

@BenCos17 BenCos17 merged commit 9a28195 into JARVIS-discordbot:Cog-Creators-V3/develop Sep 1, 2024
26 of 28 checks passed
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @BenCos17 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

----------
text : str
The text for the header.
url : Literal['small', 'medium', 'large']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: Incorrect parameter name in docstring

The parameter name in the docstring should be 'size' instead of 'url' to match the function signature.

BenCos17 added a commit that referenced this pull request Sep 1, 2024
* [Trivia] Correct Stephen to Steven (Cog-Creators#6434)

Co-authored-by: Artemis6969 <82315185+Artemis6969@users.noreply.github.com>

* Generate default LL server config and attach it to GH release (Cog-Creators#6430)

* [Audio] Update Lavalink.jar and yt source build numbers (Cog-Creators#6435)

Co-authored-by: Jakub Kuczys <me@jacken.men>

* [Audio] Fix trying to send notify message with no channel object (Cog-Creators#6429)

* Bump dependencies (Cog-Creators#6436)

* Red 3.5.13 - Changelog (Cog-Creators#6437)

* Automated Crowdin downstream (Cog-Creators#6439)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Version bump to 3.5.13 (Cog-Creators#6438)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Fix publish release workflow

* Add missing perm to Publish Release workflow

* Change Red 3.5.13 release date

* Version bump to 3.5.14.dev1

* [Trivia] Correct typos in World Cup trivia list for Golden Glove questions (Cog-Creators#6441)

* Split out non-Python assets in Publish Release workflow (Cog-Creators#6440)

* Add `header`, `hyperlink` and `subtext` utilities (Cog-Creators#6102) (#19)

Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com>
Co-authored-by: Kowlin <10947836+Kowlin@users.noreply.github.com>

---------

Co-authored-by: Guyonsteroids <82315185+Guyonsteroids@users.noreply.github.com>
Co-authored-by: Artemis6969 <82315185+Artemis6969@users.noreply.github.com>
Co-authored-by: Jakub Kuczys <me@jacken.men>
Co-authored-by: aikaterna <20862007+aikaterna@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Mellow <89431994+mellow-org@users.noreply.github.com>
Co-authored-by: Kreusada <67752638+Kreusada@users.noreply.github.com>
Co-authored-by: Kowlin <10947836+Kowlin@users.noreply.github.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants