-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Set python version to 3.8 #494
Conversation
WalkthroughWalkthroughThe changes involve downgrading the Python version from 3.12 to 3.8 across different configurations, including Docker and GitHub Actions. The control flow in specific source files is refactored from using Changes
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (5)
Additional context usedRuff
Additional comments not posted (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 1
Outside diff range comments (2)
source/hooks/shortcodes.py (1)
Line range hint
12-12
: Add missing annotations and handle unused argumentsThe function
on_page_markdown
lacks some type annotations and has unused arguments. Here's a suggested fix:- def on_page_markdown(markdown: str, *args, **kwargs): + def on_page_markdown(markdown: str) -> str:This refactoring removes unused parameters and adds a missing return type annotation.
Tools
Ruff
26-26: Unnecessary
else
afterreturn
statement (RET505)
27-27: Avoid specifying long messages outside the exception class (TRY003)
source/hooks/html_tag_modifier.py (1)
Line range hint
24-28
: Add missing annotations in Extension class methodsThe
extendMarkdown
andon_config
methods are missing some type annotations and have unused arguments. Here's how to address these issues:- def extendMarkdown(self, md: markdown.Markdown): + def extendMarkdown(self, md: markdown.Markdown) -> None: - def on_config(config: MkDocsConfig, **kwargs): + def on_config(config: MkDocsConfig) -> MkDocsConfig:This change adds the necessary type annotations and simplifies the function signatures by removing unused parameters.
if tag == "my": | ||
return _my_link(args, **kwargs) | ||
else: | ||
raise RuntimeError(f"Unknown shortcode: {tag}") |
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.
Refactored error handling in shortcode processing
The refactoring to use if-else
instead of a match
statement and the addition of an explicit error for unknown shortcode tags improves error handling and code clarity.
- else:
- raise RuntimeError(f"Unknown shortcode: {tag}")
+ else:
+ raise RuntimeError("Unknown shortcode: {}".format(tag))
This change simplifies the exception message to avoid specifying the tag in the message directly, which aligns with best practices for exception messages.
Committable suggestion was skipped due to low confidence.
Tools
Ruff
26-26: Unnecessary
else
afterreturn
statement (RET505)
27-27: Avoid specifying long messages outside the exception class (TRY003)
No description provided.