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

Breaking existing numpy docstring. #128

Open
galyfray opened this issue Jan 17, 2023 · 0 comments
Open

Breaking existing numpy docstring. #128

galyfray opened this issue Jan 17, 2023 · 0 comments

Comments

@galyfray
Copy link

When running pyment on a file with already existing docstrings pyment will try to add again the arguments.

Running pyment on the following file

def add(left: int, right: int) -> int:
    """
    Add two intergers together.
    
    Really high tech !

    Parameters
    ----------
    left : int :
        Left element to add
    right : int :
        right element to add
  
    Returns
    -------

    
    """
    return left + right

will result in this file (the bug still occurs with or without the -w arg):

def add(left: int, right: int) -> int:
    """
    Add two intergers together.
    
    Really high tech ! like woa !

    Parameters
    ----------
    left : int :
        Left element to add
    right : int :
        right element to add
    left: int :
        
    right: int :
        

    Returns
    -------

    
    """
    return left + right

I at first thought that pyment was hard checking for the presence of those two lines, but it does not seem to be the case :

def add(left: int, right: int) -> int:
    """
    Add two intergers together.
    
    Really high tech ! like woa !

    Parameters
    ----------
    left : int :
        Left element to add
    right : int :
        right element to add
    left : int :
        
    right : int :
        
    left: int :
        
    right: int :
        

    Returns
    -------

    
    """
    return left + right

Tested on python 3.10.8, pyment 0.3.3

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

No branches or pull requests

1 participant