Skip to content

Conversation

@fishermand46
Copy link

The specification for multi-line comments said to indent two spaces after the '#', but the example shoed three spaces. I fixed the specification to be consistent with the example.

Fixes Issue #352.

The specification for multi-line comments said to indent two spaces after the '#', but the example shoed three spaces. I fixed the specification to be consistent with the example.

Fixes Issue #352.
@fishermand46
Copy link
Author

Any updates on this?

@bbatsov
Copy link
Collaborator

bbatsov commented Nov 4, 2014

I'm not sure whether the description or the example is incorrect. :-) I'll have to double check this.

@fishermand46
Copy link
Author

'ight. I was wondering the same thing. :) Thanks!

@erran
Copy link
Contributor

erran commented Jan 24, 2015

subsequent lines should be indented twothree spaces after the #.

@fishermand46's change is correct in that it is three spaces after the #. Possibly adjust the comment to:

subsequent lines should be indented two spaces after the beginning of the annotation (three spaces after the #).

EDIT:
#346 actually used something similar to my suggestion.

@bbatsov
Copy link
Collaborator

bbatsov commented Jan 24, 2015

@erran Let's merge #346 as it was submitted first. I had totally forgot about it.

@bbatsov bbatsov closed this Jan 24, 2015
@snowe2010
Copy link

Does this indentation apply to regular comments as well or only annotations? The guide is not clear about it and I didn't want to open a new issue for such a little thing.

@onebree
Copy link
Contributor

onebree commented Apr 30, 2015

In Vim, when I begin a comment (no matter initial indentation) with #, hitting enter will begin the next line with the same 2 characters.

To be clear, any commenting rules should be in one section. (Excuse my on-the-fly wording/examples!)

  1. Begin all comments with #
  2. Except for in-line comments, try to write block comments out as sentences.
  3. Avoid using =begin/=end as it is generally unreadable, and does not allow indentation
  4. When comments need to include an example, indent one additional time.
string = "Hello"    # sample inline comment

# This is a sample GOOD comment.

#A sample *okay* comment

=begin
  Sample bad comment blocking
    Especially with leading white space
=end

# sample block comment with indents
# Sample of regular route:
#   match 'products/:id' => 'catalog#view'
# Keep in mind you can assign values other than :controller and :action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants