Skip to content

Optionally allow adding - returns: docs to initializers #557

Closed
@mohpor

Description

Hi,
I use VVDocumenter to help me document my codes.
init() functions return an objects, although not explicitly defined in their syntax. For this particular reason, SwiftLint-ing them complains that their documentations are invalid.

example:

 /**
   Generates the view programatically to avoid giving out informations about the alert's views.   
   - parameter frame: A frame. Will be ignored.   
   - returns: An instance of UIView.
   */
  override init(frame: CGRect) {...}

(Disclaimer: This is just an example)

Swift lint will complain and say:

warning: Valid Docs Violation: Documented declarations should be valid. (valid_docs)

Although it is perfectly valid. You might argue that we don't need to document the return part, but I have many cases that it helps clarify the resulted instance, especially in case of failable initializers.

UPDATE:
Just to be clear, removing - returns from documentation does actually solve the validation problem.

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected and reproducible misbehavior.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions