Skip to content

public_member_api_docs should not require docs for trivial constructors #57361

Open
@yjbanov

Description

@yjbanov

There are situations when doc comments are not useful in a constructor:

The following is common in classes used as annotations:

/// Docs.
class Foo {
  /// Not much to say here but public_member_api_docs insists.
  Foo();
}

Even when the constructor has parameters, if the parameters assign to public fields that are documented, there isn't much to say in the constructor:

/// Docs.
class Foo {
  /// Not much to say here but public_member_api_docs insists
  Foo(this.bar, this.baz);

  /// Docs.
  final bar;

  /// Docs.
  final baz;
}

@pq @Hixie

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.customer-flutterdevexp-linterIssues with the analyzer's support for the linter packagelinter-false-positiveIssues related to lint rules that report a problem when it isn't a problem.type-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions