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: Use more precise name instead of object_name for _sort_summary_list error msg #244

Merged
merged 2 commits into from
Apr 7, 2024

Conversation

mansenfranzen
Copy link
Owner

@mansenfranzen mansenfranzen commented Apr 7, 2024

Type

bug_fix


Description

  • Updated the error message in _sort_summary_list method to use self.name instead of self.object_name, enhancing error clarity and precision.

Changes walkthrough

Relevant files
Bug fix
autodocumenters.py
Update Error Message for Precise Naming in `_sort_summary_list`

sphinxcontrib/autodoc_pydantic/directives/autodocumenters.py

  • Updated the error message in _sort_summary_list to use self.name
    instead of self.object_name for more precise error reporting.
  • +1/-1     

    PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    Copy link
    Contributor

    github-actions bot commented Apr 7, 2024

    PR Description updated to latest commit (e392942)

    Copy link
    Contributor

    github-actions bot commented Apr 7, 2024

    PR Review

    ⏱️ Estimated effort to review [1-5]

    1, because the PR involves a simple change in a string for error messaging, which is straightforward to review. The change is localized to a single line in one file, and the context of the change is clear from the PR description.

    🧪 Relevant tests

    No

    🔍 Possible issues

    Missing space in error message: The updated error message concatenates self.name directly with the preceding text without a space, which could lead to a malformed error message.

    🔒 Security concerns

    No

    Code feedback:
    relevant filesphinxcontrib/autodoc_pydantic/directives/autodocumenters.py
    suggestion      

    Add a space before the variable self.name in the error message to ensure proper formatting. This change is important because without the space, the error message will concatenate the model name directly to the preceding text, potentially causing confusion. [important]

    relevant linef'{self.name} with sort order {sort_order}.'


    ✨ Review tool usage guide:

    Overview:
    The review tool scans the PR code changes, and generates a PR review which includes several types of feedbacks, such as possible PR issues, security threats and relevant test in the PR. More feedbacks can be added by configuring the tool.

    The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.

    • When commenting, to edit configurations related to the review tool (pr_reviewer section), use the following template:
    /review --pr_reviewer.some_config1=... --pr_reviewer.some_config2=...
    
    [pr_reviewer]
    some_config1=...
    some_config2=...
    

    See the review usage page for a comprehensive guide on using this tool.

    Copy link
    Contributor

    github-actions bot commented Apr 7, 2024

    PR Code Suggestions

    CategorySuggestions                                                                                                                                                       
    Enhancement
    Add a space before the model name in the error message for better readability.

    Add a space before the model name in the error message to ensure proper formatting.
    Without this space, the model name will be directly attached to the word 'model', which
    might confuse users or make the log harder to read.

    sphinxcontrib/autodoc_pydantic/directives/autodocumenters.py [578]

    -f'{self.name} with sort order {sort_order}.'
    +f' {self.name} with sort order {sort_order}.'
     

    ✨ Improve tool usage guide:

    Overview:
    The improve tool scans the PR code changes, and automatically generates suggestions for improving the PR code. The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on a PR.

    • When commenting, to edit configurations related to the improve tool (pr_code_suggestions section), use the following template:
    /improve --pr_code_suggestions.some_config1=... --pr_code_suggestions.some_config2=...
    
    [pr_code_suggestions]
    some_config1=...
    some_config2=...
    

    See the improve usage page for a comprehensive guide on using this tool.

    @mansenfranzen mansenfranzen merged commit 42bdd4b into main Apr 7, 2024
    34 of 36 checks passed
    @mansenfranzen mansenfranzen deleted the fix_name_instead_of_object branch April 7, 2024 09:45
    @github-actions github-actions bot mentioned this pull request Apr 5, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant