Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Usage of do...end block syntax in conditionals #859

Open
@adi-pen

Description

@adi-pen

I encountered a situation where ado...end block syntax is used as a work-around to avoid line limits.

Example:

# frozen_string_literal: trueif [].any? do |variable|  # do somethingend  trueend

Indenting the block by one level helps identify the end of the conditional easily but still does not feel naturalat least to me. This results in aLayout/BlockAlignment offense.

# frozen_string_literal: trueif [].any? do |variable|    # do something  end  trueend

Could we enforce thatdo..end blocks are not used in conditionals or have a style-preference if we support it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp