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

feat: add function in namespace snippet #116

Merged

Conversation

barnou-psee
Copy link
Contributor

@barnou-psee barnou-psee commented Nov 22, 2024

Summary by Sourcery

Add functionality to support namespace-specific function documentation by introducing doxyNamespaceFunction in finder.py and updating generatorSnippets.py to handle this new feature. Update the documentation to reflect these changes.

New Features:

  • Introduce a new function doxyNamespaceFunction in the finder.py to locate functions within a specific namespace.

Enhancements:

  • Add support for namespace.function in generatorSnippets.py to handle namespace-specific function documentation.

Documentation:

  • Update functions.md to include documentation for the new doxy.<project>.namespace.function tag, explaining its usage and parameters.

Copy link

sourcery-ai bot commented Nov 22, 2024

Reviewer's Guide by Sourcery

This PR adds support for documenting functions within namespaces by introducing a new documentation tag '::: doxy..namespace.function'. The implementation includes new finder methods for namespaces and namespace functions, along with corresponding generator functionality.

Class diagram for updated finder methods

classDiagram
    class Finder {
        +doxyClass(project, className: str)
        +doxyNamespace(project, namespace: str)
        +doxyClassMethod(project, className: str, methodName: str)
        +doxyNamespaceFunction(project, namespace: str, functionName: str)
        +doxyFunction(project, functionName: str)
    }
    note for Finder "Added doxyNamespace and doxyNamespaceFunction methods"
Loading

Class diagram for updated generator snippets

classDiagram
    class GeneratorSnippets {
        +doxyNamespaceList(snippet, project: str, config)
        +doxyNamespaceFunction(snippet, project: str, config)
        +doxyFileList(snippet, project: str, config)
    }
    note for GeneratorSnippets "Added doxyNamespaceFunction method"
Loading

File-Level Changes

Change Details Files
Added new documentation tag for namespace functions
  • Added documentation for the '::: doxy..namespace.function' tag
  • Added example usage and error message documentation
  • Included parameter description table
docs/snippets/functions.md
Implemented namespace and namespace function finder methods
  • Added doxyNamespace method to find namespace nodes
  • Added doxyNamespaceFunction method to find functions within namespaces
  • Implemented recursive search functionality for namespace functions
mkdoxy/finder.py
Added namespace function generator support
  • Added 'namespace.function' to doxy_arguments dictionary
  • Implemented doxyNamespaceFunction generator method
  • Added error handling and link prefix configuration
mkdoxy/generatorSnippets.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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 @barnou-psee - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Error message in doxyNamespaceFunction references 'Class' instead of 'Namespace' in the error text - this should be updated to match the actual functionality
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟡 Complexity: 1 issue found
  • 🟢 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.

mkdoxy/generatorSnippets.py Outdated Show resolved Hide resolved
docs/snippets/functions.md Outdated Show resolved Hide resolved
mkdoxy/finder.py Show resolved Hide resolved
@barnou-psee barnou-psee force-pushed the fix/function-in-namespace branch from e7ffc19 to 33a83c0 Compare November 22, 2024 09:16
@barnou-psee barnou-psee changed the title (WIP) feat: add function in namespace snippet feat: add function in namespace snippet Nov 22, 2024
@JakubAndrysek
Copy link
Owner

JakubAndrysek commented Nov 22, 2024

I have tested it in a new environment.

Main branch
image


This branch ![image](https://github.com/user-attachments/assets/d0bd04e1-3e6d-4e0c-8c6c-012623c0a4c8) Do you have the same result?

@barnou-psee barnou-psee force-pushed the fix/function-in-namespace branch from 33a83c0 to db1fb4d Compare November 22, 2024 10:35
@barnou-psee
Copy link
Contributor Author

Hello, sorry I executed mkdocs serve and this is what I have on my PR after some bugfix:

image

image

@JakubAndrysek JakubAndrysek merged commit 517ff74 into JakubAndrysek:main Nov 22, 2024
13 checks passed
@JakubAndrysek
Copy link
Owner

Thank you for the help, merged in https://pypi.org/project/mkdoxy/1.2.6/

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.

2 participants