Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d65e619

Browse files
Robert Solybbatsov
authored andcommitted
Cleanup magic comments section
#A
1 parent b8b5cd4 commit d65e619

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2498,32 +2498,39 @@ no parameters.
24982498
### Magic Comments
24992499
25002500
* <a name="magic-comments-first"></a>
2501-
Place magic comments above all code and documentation. Magic comments should only go below shebangs if they are needed in your source file.
2502-
<sup>[[link](#magic-comments-first)]</sup>
2501+
Place magic comments above all code and documentation in a file (except shebangs, which are discussed next).
25032502
25042503
```ruby
25052504
# good
25062505
# frozen_string_literal: true
2506+
25072507
# Some documentation about Person
25082508
class Person
25092509
end
25102510
25112511
# bad
25122512
# Some documentation about Person
2513+
25132514
# frozen_string_literal: true
25142515
class Person
25152516
end
25162517
```
25172518
2519+
* <a name="below-shebang"></a>
2520+
Place magic comments below shebangs when they are present in a file.
2521+
<sup>[[link](#below-shebang)]</sup>
2522+
25182523
```ruby
25192524
# good
25202525
#!/usr/bin/env ruby
25212526
# frozen_string_literal: true
2527+
25222528
App.parse(ARGV)
25232529
25242530
# bad
25252531
# frozen_string_literal: true
25262532
#!/usr/bin/env ruby
2533+
25272534
App.parse(ARGV)
25282535
```
25292536

0 commit comments

Comments
 (0)