Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control flow keywords should begin their line #785

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,19 @@ end

== Flow of Control

=== Control Flow Keywords [[control-flow-keywords]]

Keywords that alter control flow, e.g. `next`, `raise`, `return`, etc. should appear at the beginning of the line.

[source,ruby]
----
# bad
makes_sense? ? "Great success!" : raise("Woah.")

# good
raise("Woah.") unless makes_sense?
----

=== No `for` Loops [[no-for-loops]]

Do not use `for`, unless you know exactly why.
Expand Down