Skip to content

Absence of “Defaults to xx.” when the parameter has a default value #246

@aust-1

Description

@aust-1

When a parameter has a default value in Google style, we must specify “Defaults to xxx.” But if we don't specify it, pydoclint doesn't report anything.

For example, for this code, pydoclint doesn't report any problems:

  def safe_digital_read(self, n: int = 5) -> bool:
          """Read the digital value multiple times and return the majority value.
  
          Args:
              n (int, optional): Number of reads to perform.
  
          Returns:
              bool: The majority value read from the pin.
          """
          ...

whereas it should be:

  def safe_digital_read(self, n: int = 5) -> bool:
          """Read the digital value multiple times and return the majority value.
  
          Args:
              n (int, optional): Number of reads to perform. Defaults to 5.
  
          Returns:
              bool: The majority value read from the pin.
          """
          ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions