Giter Site home page Giter Site logo

Comments (4)

jsh9 avatar jsh9 commented on May 28, 2024 1

Thanks for the clarification!

I made a code change and now your test case should produce the following error message:

pydoclint/tests/test_main.py

Lines 1090 to 1097 in bef414f

[
'DOC101: Function `f`: Docstring contains fewer arguments than in function '
'signature. ',
'DOC103: Function `f`: Docstring arguments are different from function '
'arguments. (Or could be other formatting issues: '
'https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). '
'Arguments in the function signature but not in the docstring: [x: int].',
],

Note that the error message shows [x: int] rather than [x: ] -- this is for backward compatibility purposes.

from pydoclint.

jsh9 avatar jsh9 commented on May 28, 2024 1

The code change is published as v0.3.4 to PyPI.

from pydoclint.

jsh9 avatar jsh9 commented on May 28, 2024

Hi @ezwelty , this is because there needs to be : in the arg list of the docstring.

Please check out the note in this error message:

DOC103: Function f: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ).

from pydoclint.

ezwelty avatar ezwelty commented on May 28, 2024

@jsh9 Did you maybe misread my issue? The : is omitted when a type is not given. See the numpy style guide (https://numpydoc.readthedocs.io/en/latest/format.html#parameters). With the following file and --arg-type-hints-in-docstring False, no errors are returned (as expected).

"""Module docstring."""


def f(x: int, y: int, z: int) -> None:
    """
    Run f().

    Parameters
    ----------
    x
        x
    y
        y
    z
        z
    """
    pass

from pydoclint.

Related Issues (20)

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.