Orphaned Doc Comment

A doc comment should be attached to a declaration

  • Identifier: orphaned_doc_comment
  • Enabled by default: Yes
  • Supports autocorrection: No
  • Kind: lint
  • Analyzer rule: No
  • Minimum Swift compiler version: 5.0.0
  • Default configuration:
    KeyValue
    severity warning

Non Triggering Examples

/// My great property
var myGreatProperty: String!
//////////////////////////////////////
//
// Copyright header.
//
//////////////////////////////////////
/// Look here for more info: https://github.com.
var myGreatProperty: String!
/// Look here for more info:
/// https://github.com.
var myGreatProperty: String!

Triggering Examples

/// My great property
// Not a doc string
var myGreatProperty: String!
/// Look here for more info: https://github.com.
// Not a doc string
var myGreatProperty: String!
/// Look here for more info: https://github.com.


// Not a doc string
var myGreatProperty: String!
/// Look here for more info: https://github.com.
// Not a doc string
/// My great property
// Not a doc string
var myGreatProperty: String!
extension Nested {
    ///
    /// Look here for more info: https://github.com.

    // Not a doc string
    var myGreatProperty: String!
}