fix(tldr): condense tldr pages by electron271 · Pull Request #851 · allthingslinux/tux · GitHub
Skip to content
This repository was archived by the owner on May 14, 2026. It is now read-only.

fix(tldr): condense tldr pages#851

Merged
electron271 merged 1 commit into
mainfrom
842--condense-tldr-pages
May 11, 2025
Merged

fix(tldr): condense tldr pages#851
electron271 merged 1 commit into
mainfrom
842--condense-tldr-pages

Conversation

@electron271

@electron271 electron271 commented May 11, 2025

Copy link
Copy Markdown

Description

closes #842
adds backslash to prevent discord list formatting and removes not needed newlines

Guidelines

  • My code follows the style guidelines of this project (formatted with Ruff)

  • I have performed a self-review of my own code

  • I have commented my code, particularly in hard-to-understand areas

  • I have made corresponding changes to the documentation if needed

  • My changes generate no new warnings

  • I have tested this change

  • Any dependent changes have been merged and published in downstream modules

  • I have added all appropriate labels to this PR

  • I have followed all of these guidelines.

How Has This Been Tested? (if applicable)

ran /tldr test

Screenshots (if applicable)

before and after
image
image

Additional Information

Please add any other information that is important to this PR.

Summary by Sourcery

Improve formatting of tldr command output to enhance readability and compatibility with Discord.

Bug Fixes:

  • Prevent Discord list formatting by escaping leading dashes in tldr output.
  • Remove unnecessary blank lines between list items and code blocks in tldr output.

@electron271 electron271 added this to the 0.1.0 milestone May 11, 2025
@electron271 electron271 requested a review from Copilot May 11, 2025 21:23
@electron271 electron271 self-assigned this May 11, 2025
@sourcery-ai

sourcery-ai Bot commented May 11, 2025

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR condenses TLDR pages by removing unnecessary newlines and escaping leading dashes to prevent Discord list formatting issues. Key changes include invoking the subprocess for TLDR, processing the output to filter unwanted blank lines, and escaping dashes.

Comments suppressed due to low confidence (1)

tux/cogs/utility/tldr.py:130

  • [nitpick] Consider enhancing the inline comment or extracting the condition into a well-named helper function to clarify the intent behind skipping blank lines between a dash and inline code.
if ( not raw.strip() and i > 0 and i < len(lines) - 1 and lines[i - 1].startswith("-") and lines[i + 1].startswith("`") ):

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 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 and I'll use the feedback to improve your reviews.

@electron271 electron271 merged commit a598bfd into main May 11, 2025
@electron271 electron271 deleted the 842--condense-tldr-pages branch May 11, 2025 21:25
@trunk-io

trunk-io Bot commented May 12, 2025

Copy link
Copy Markdown

⏱️ 4m total CI duration on this PR

Job Cumulative Duration Recent Runs
docker 2m 🟩
Analyze (python) 59s 🟩
Analyze (actions) 50s 🟩
pyright 38s 🟩
Ruff 19s 🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@electron271

Copy link
Copy Markdown
Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants