Skip to content

Commit

Permalink
Add example for Style/TrailingBodyOnMethodDefinition
Browse files Browse the repository at this point in the history
Follow #9548 (comment).

This PR adds example for `Style/TrailingBodyOnMethodDefinition`.
  • Loading branch information
koic authored and bbatsov committed Mar 5, 2021
1 parent 930c812 commit 3b9ad8f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rubocop/cop/style/trailing_body_on_method_definition.rb
Expand Up @@ -5,6 +5,8 @@ module Cop
module Style
# This cop checks for trailing code after the method definition.
#
# NOTE: It always accepts endless method definitions that are basically on the same line.
#
# @example
# # bad
# def some_method; do_stuff
Expand All @@ -24,6 +26,8 @@ module Style
# b[c: x]
# end
#
# def endless_method = do_stuff
#
class TrailingBodyOnMethodDefinition < Base
include Alignment
include TrailingBody
Expand Down

0 comments on commit 3b9ad8f

Please sign in to comment.