0

I'm trying to add a linter to a repo that would enforce docstring documentation of arguments and return values for functions and methods, as described in the Google Python Style Guide.

In general, I want to enforce the following docstring content:

def blah(n: int) -> int:
    """
    Args:
        n: a number
    
    Returns:
        The number plus 1
    """
    return n+1

I looked into YAPF, Google's own Python formatting tool, but could not find a configuration argument and return values. A broader search on this subject did not yield anything.

How can I enforce argument and return value documentation in a docstring using a linter?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Adam Matan
  • 128,757
  • 147
  • 397
  • 562

0 Answers0