sphinx-contrib / napoleon

Other
148 stars 48 forks source link

[Support] Documented "Attributes" with type hints are duplicated. #21

Open alexlatchford opened 4 years ago

alexlatchford commented 4 years ago

Screen Shot 2020-02-20 at 9 52 51 AM

If we have a class definition like this:

@dataclass
class DatadogMetricName:
    """Create a machine readable metric name for human readable metric names.

    Attributes:
        human_readable_name: The metric name to be converted to Datadog metric naming conventions.
        machine_readable_name: The metric name that follows Datadog metric naming conventions.

    Example:
        Given a string, Standard Pool (rectangular or curved), this would
        be converted to the following metric name::

            standard_pool_rectangular_or_curved
    """
    metric_prefix: InitVar[str]
    human_readable_name: InitVar[str]
    default_metric_name: InitVar[str]
    machine_readable_name: str = None

Looks like it doesn't correctly reconcile the docs auto-generated by the type hints and those manually curated for the description. Any suggestions?