Module: Yard::Lint::Validators::Documentation::EmptyCommentLine

Defined in:
lib/yard/lint/validators/documentation/empty_comment_line.rb,
lib/yard/lint/validators/documentation/empty_comment_line/config.rb,
lib/yard/lint/validators/documentation/empty_comment_line/parser.rb,
lib/yard/lint/validators/documentation/empty_comment_line/result.rb,
lib/yard/lint/validators/documentation/empty_comment_line/validator.rb,
lib/yard/lint/validators/documentation/empty_comment_line/messages_builder.rb

Overview

EmptyCommentLine validator

Detects empty comment lines at the start or end of YARD documentation blocks. Empty lines BETWEEN tag groups are allowed for readability.

Configuration

To check only leading empty lines:

Documentation/EmptyCommentLine:
  EnabledPatterns:
    Leading: true
    Trailing: false

To disable this validator:

Documentation/EmptyCommentLine:
  Enabled: false

Examples:

Bad - Empty leading comment line

#
# Description of the method
# @param value [String] the value
def process(value)
end

Bad - Empty trailing comment line

# Description of the method
# @param value [String] the value
#
def process(value)
end

Good - No leading or trailing empty lines

# Description of the method
# @param value [String] the value
def process(value)
end

Good - Empty line between sections (allowed)

# Description of the method
#
# @param value [String] the value
# @return [Boolean] success
def process(value)
end

Defined Under Namespace

Classes: Config, MessagesBuilder, Parser, Result, Validator