Skip to content
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

Fix authors bug #46

Merged
merged 4 commits into from
Feb 20, 2024
Merged

Fix authors bug #46

merged 4 commits into from
Feb 20, 2024

Conversation

glenn-jocher
Copy link
Member

@glenn-jocher glenn-jocher commented Feb 20, 2024

@AyushExel this should resolve the authors bug, and also does not attempt to determine authors if the user disabled authors.

πŸ› οΈ PR Summary

Made with ❀️ by Ultralytics Actions

🌟 Summary

Enhancements and fixes to the mkdocs-ultralytics-plugin for improved documentation features and reliability.

πŸ“Š Key Changes

  • Changed the default setting for adding JSON-LD structured data from True to False.
  • Updated the get_git_info method to be non-static and now includes a docstring explaining its purpose.
  • Incorporated a conditional check for the 'add_authors' configuration before fetching author information.
  • Added docstrings to on_page_content and insert_content methods for better clarity on their functionality.
  • Optimized GitHub username extraction from noreply email addresses to handle edge cases.
  • Incremented the project version in pyproject.toml from 0.0.43 to 0.0.44.

🎯 Purpose & Impact

  • Changing the JSON-LD default setting to False reduces the processing overhead for users who do not need structured data, leading to potentially faster build times.
  • The updates to get_git_info aim to provide better context to developers on how git information is retrieved and used within the page content, enhancing maintainability.
  • The conditional author information retrieval aligns author section addition with user configuration, offering more control over documentation customization.
  • New docstrings serve as in-code documentation, improving the understanding and maintainability of the codebase for current and future developers.
  • The fix for GitHub username extraction ensures accurate authorship representation, thus maintaining the integrity of the documentation's meta information.
  • The version bump signifies the improvements and bug fixes in this iteration of the plugin to the users.

@glenn-jocher
Copy link
Member Author

@AyushExel also defaults add_authors to False

Copy link
Contributor

@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.

PR Type: Enhancement

PR Summary: This pull request introduces several enhancements to the MetaPlugin class within the plugin's main module. It modifies the default behavior of the 'add_json_ld' configuration option, changes the 'get_git_info' method from a static method to an instance method, and adds conditional logic to only gather author information if the 'add_authors' configuration is enabled. Additionally, it includes updates to the documentation of methods to better describe their functionality and purpose. The changes aim to fix a bug related to author information processing and improve the plugin's flexibility and configurability.

Decision: Comment

πŸ“ Type: 'Enhancement' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
βœ… Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
πŸ“ Complexity: the changes are too large or complex for Sourcery to approve.
  • Unsupported files: the diff contains files that Sourcery does not currently support during reviews.

General suggestions:

  • Ensure that the change in default behavior for the 'add_json_ld' configuration option is clearly documented in the release notes to prevent any unexpected behavior for existing users.
  • Consider adding unit tests or modifying existing ones to cover the new conditional logic in the 'get_git_info' method, ensuring that author information is only processed when enabled.
  • Review the impact of changing 'get_git_info' from a static to an instance method on the rest of the codebase to ensure that all calls to this method have been appropriately updated.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click πŸ‘ or πŸ‘Ž on each comment to tell me if it was helpful.

plugin/main.py Show resolved Hide resolved
@glenn-jocher glenn-jocher merged commit b434011 into main Feb 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant