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

SIG401 false positive #427

Closed
FlotterCodername opened this issue Aug 28, 2024 · 2 comments · Fixed by #430
Closed

SIG401 false positive #427

FlotterCodername opened this issue Aug 28, 2024 · 2 comments · Fixed by #430
Assignees
Labels
bug Something isn't working

Comments

@FlotterCodername
Copy link

FlotterCodername commented Aug 28, 2024

Using an rst directive with an indent of 3 spaces can lead to a false positive regarding the indentation of params.
When using 4 spaces, this false positive does not appear.

Please note that 3-space indent style is the one preferred by docutils and sphinx docs also.
When nesting rst statements, you end up with unsightly/unpredicable results quickly if you try to enforce 4-space indentation.

def method(*, arg1 = "") -> str:
    """
    Description text

    .. code-block:: python
       print()

    :param arg1: text
    :return: text
    :raises TypeError: Incorrect argument(s)
    """
    return ""

Expected: no error

Environment:

  • Python version: 3.11.6
  • docsig version: 0.60.0
@jshwi jshwi self-assigned this Aug 29, 2024
@jshwi jshwi added the bug Something isn't working label Aug 29, 2024
jshwi added a commit that referenced this issue Aug 29, 2024
Description or anything else is out of scope

Signed-off-by: Stephen Whitlock <stephen@jshwisolutions.com>
@jshwi jshwi linked a pull request Aug 29, 2024 that will close this issue
@jshwi
Copy link
Owner

jshwi commented Aug 29, 2024

Hi @FlotterCodername

Thanks for spotting this, and logging this issue. It helps a lot to improve this package

This goes against the expected behaviour. I don't think the docstring description should be raising errors. The intended scope is to check function signature documentation

I've added the fix, and your code-blocks should not raise any errors anymore

This is available with version 0.60.1. Hope this helps! Please don't hesitate to raise another issue if you come across anything else

Cheers,
Stephen

@FlotterCodername
Copy link
Author

Hi Stephen,

wow that was fast, thanks so much! If anything comes up, I will definitely take care to write a good issue.
Thank you for all the hard work and helping us make our Python docs better!

Best regards
Fabian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants