Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint public_member_api_docs false positive #5070

Open
matanlurey opened this issue Aug 19, 2024 · 1 comment
Open

Lint public_member_api_docs false positive #5070

matanlurey opened this issue Aug 19, 2024 · 1 comment
Labels
false-positive P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@matanlurey
Copy link
Contributor

The analyzer and dartdoc understand this is documented, but the lint rule does not:

// lib/format.dart
/// A format.
class Format {
  /// Is documented to do a thing.
  void doThing() {}
}

/// A mixin that adds a method to [Format].
mixin FormatMixin1 on Format {
  @override
  void doThing({String? optionalString}) {}
}

/// A mixin that adds a method to [Format].
mixin FormatMixin2 on Format {
  @override
  void doThing({int? optionalInteger}) {}
}

/// A mixin that is both [FormatMixin1] and [FormatMixin2].
mixin FormatMixins on Format implements FormatMixin1, FormatMixin2 {
  // Missing documentation for a public member.
  // Try adding documentation for the member.dart[public_member_api_docs] 
  // (https://dart.dev/lints/public_member_api_docs)
  @override
  void doThing({String? optionalString, int? optionalInteger}) {}
}

Dart SDK version: 3.5.0 (stable) (Tue Jul 30 02:17:59 2024 -0700) on "macos_arm64"

@dart-github-bot
Copy link

Summary: The public_member_api_docs lint incorrectly flags a method in a mixin as undocumented, even though the method is documented in a superclass mixin. This occurs when a mixin inherits from multiple mixins, each of which overrides the same method with different optional parameters.

@dart-github-bot dart-github-bot added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Aug 19, 2024
@lrhn lrhn transferred this issue from dart-lang/sdk Aug 20, 2024
@pq pq added the P2 A bug or feature request we're likely to work on label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false-positive P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

4 participants