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

feature: Start at the first non-empty line? #6

Closed
pawamoy opened this issue Jul 11, 2024 · 1 comment
Closed

feature: Start at the first non-empty line? #6

pawamoy opened this issue Jul 11, 2024 · 1 comment
Assignees
Labels
feature New feature or request

Comments

@pawamoy
Copy link
Owner

pawamoy commented Jul 11, 2024

Is your feature request related to a problem? Please describe.

Once support for comments in docstrings is implemented, it will still be hard to mark lines or blocks to be removed because that could break parsing of the docstring.

For example:

    """Create and return a warn function.

    <!-- YORE: Bump 1: Remove block. -->
    Parameters:
        name: Deprecated. The logger name.

    Returns:
        A function used to log parsing warnings.
    """

Here the Yore comment would break parsing of the parameters section, because the parser requires that the line above a section is blank.

Describe the solution you'd like

Support having blank lines after a comment? And start only at the first non-blank line?

# YORE: ...

print("...")

"""Summary.

<!-- YORE: ... -->

Parameters:
    ...
"""

Describe alternatives you've considered

Write comments right before their target anyway, and create a Griffe extension to make them blank instead (not removing the line, just emptying it).

Additional context

This suggested solution won't solve the issue that we can't add Yore comments inside sections themselves anyway, so we might be better off creating a Griffe extension 🤔

@pawamoy pawamoy added the feature New feature or request label Jul 11, 2024
@pawamoy pawamoy self-assigned this Jul 11, 2024
@pawamoy
Copy link
Owner Author

pawamoy commented Aug 14, 2024

Extension idea tracked here: mkdocstrings/griffe#313

@pawamoy pawamoy closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant