Skip to content

Commit

Permalink
Merge pull request #57 from nekketsuuu/nekketsuuu-eof-empty-lines
Browse files Browse the repository at this point in the history
Clarify about empty lines around EOF
  • Loading branch information
Takuya Kosugiyama authored Jan 23, 2020
2 parents 7382988 + 688c40c commit 590bca6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Layout/TrailingWhitespace:
# Empty lines
########################

# [MUST] Do not put empty lines at the end of a file.
# [MUST] Leave exactly one newline at the end of a file.
Layout/TrailingEmptyLines:
EnforcedStyle: final_newline

Expand Down
16 changes: 15 additions & 1 deletion ruby.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,21 @@ To ensure readability and consistency within the code, the guide presents a numb

## Empty lines

- **[MUST]** Do not put empty lines at the end of a file.
- **[MUST]** Leave exactly one newline at the end of a file.

``` ruby
# bad
class Foo; end
# EOF
# bad
class Foo; end # EOF
# good
class Foo; end
# EOF
```

## Character encoding and magic comments

Expand Down
16 changes: 15 additions & 1 deletion ruby.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,21 @@ Ruby プログラマとしての素養をある程度備えている者なら誰
<a name="empty-lines"></a>
## 空行

- **[MUST]** ファイルの末尾に空行を置いてはならない。
- **[MUST]** ファイルの末尾ではちょうど1回だけ改行する。

``` ruby
# bad
class Foo; end
# EOF
# bad
class Foo; end # EOF
# good
class Foo; end
# EOF
```

<a name="character-encoding-and-magic-comments"></a>
## 文字エンコーディングとマジックコメント
Expand Down

0 comments on commit 590bca6

Please sign in to comment.