Skip to content

missing_docs doesn't trigger for non-inherited properties/functions when using excludes_inherited_types #5633

@bobbradley

Description

@bobbradley

New Issue Checklist

Describe the bug

If missing_docs is enabled and excludes_inherited_types is true then undocumented and non-inherited public properties/functions don't trigger missing_docs warnings if the type inherits from a protocol. For example:

/// My type.
public struct MyType: Identifiable {
    public id: String // No warning expected here because this property comes from `Identifiable`.

    // Warning expected here because it's not inherited from `Identifiable`, but warning is not reported.
    public name: String
}
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
Linting Swift files in current working directory
Linting 'Test.swift' (1/1)
Done linting! Found 0 violations, 0 serious in 1 file.

Environment

  • SwiftLint version: 0.55.1
  • Installation method used: Homebrew
  • Paste your configuration file:
opt_in_rules:
  - missing_docs

missing_docs:
  excludes_inherited_types: true
  • Are you using nested configurations?
    No
  • Which Xcode version are you using (check xcodebuild -version)?
    Reproduces without Xcode.
  • Do you have a sample that shows the issue?
    Yes:
/// My type.
public struct MyType: Identifiable {
    public id: String // No warning expected here because this property comes from `Identifiable`.

    // Warning expected here because it's not inherited from `Identifiable`, but warning is not reported.
    public name: String
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptable-false-positiveFalse positives caused by rules that are unavoidable due to missing type information.bugUnexpected and reproducible misbehavior.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions