Giter Club home page Giter Club logo

numdoclint's Issues

Return statement judgement is not collect

How to reproduce:

def _run_command(command: str) -> None:
    """
    Run the specified command.

    Parameters
    ----------
    command : str
        The command string.

    Raises
    ------
    Exception
        If the command result code is not 0.
    """
    logger.info(f'Command started: {command}')
    popen = sp.Popen(
        command, shell=True, stdout=sp.PIPE, stderr=sp.STDOUT)
    stdout_bytes: bytes = popen.communicate()[0]
    try:
        stdout: str = stdout_bytes.decode('utf-8')
    except Exception:
        stdout = stdout_bytes.decode('sjis')
    logger.info(stdout)
    if popen.returncode == 0:
        return
    raise Exception(f'Command failed: {popen.returncode}')

Lint result :

While the return value exists in the function, the return value document does not exist in docstring.

Add a check of misspelling

e.g., Parmeters, Retuns.

Check NumPy and Pandas and use a list of section labels (e.g., Parameters, Returns, Raises, Examples, etc) used by theirs.

BUG: doesn't recognize docstring if closing bracket of function is black-style

Hi, I really like the package you've made, and our team is looking at using it to enforce well-written docstrings before new merges are made to the master branch of our codebase.

But we also use black to format all our code, and there's a frustrating incompatibility between the way black formats a function with too many parameters to fit on a line, and the way numdoclint reads that function and its docstring.

(Or at least for a class method, which is the specific example I'm looking at).

Specifically, we have this method:

    def decompress(
        raw_string: str, base64_decode: bool = True, json_load: bool = True
    ) -> str:
        """
        Decompress raw string...

and black makes the closing bracket of the function's parameters line up with the initial def keyword, while numdoclint doesn't seem to recognize the docstring unless the closing bracket is indented like parameters on the line above, eg.

    def decompress(
        raw_string: str, base64_decode: bool = True, json_load: bool = True
        ) -> str:
        """
        Decompress raw string...

Full example here: https://asciinema.org/a/477219?speed=3

If this could be fixed that would be much appreciated!

Fix same function name pattern

Currently following pattern (i.e., same name function in one module) is not compatible.

def sample_func_1():
    def sample_func_2():
        pass

def sample_func_2():
    pass

Add a functionality to check Jupyter's notebook

TODO:

  • Update README.
  • Rename
    • get_single_func_info_list.module_path -> path
    • get_single_func_info_list.module_str -> code_str
    • get_func_name_list.py_module_str -> code_str
  • Add recursive interface
  • Add interface to __init__.py

not correct to get argument name when type specification is omitted

def sample_func(price):
    """
    Sample function.

    Parameters
    ----------
    price
        Sample price (type not specified).
    """
    pass
./sample.py::sample_func
An argument exists in docstring does not exists in the actual argument.
Lacked argument name: price
        Sample price (type not specified).

./sample.py::sample_func
There is an argument whose explanation does not exist in docstring.
Target argument name: price

./sample.py::sample_func
Missing docstring argument type information.
Target argument: price
        Sample price (type not specified).

./sample.py::sample_func
The order of the argument and docstring is different.
Order of arguments: ['price']
Order of docstring parameters: ['price\n        Sample price (type not specified).']

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.