Last active
August 29, 2015 14:25
-
-
Save thash/1230d1e4a9e9158b41cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Style/SpaceAroundOperators: | |
Enabled: false | |
Style/BlockDelimiters: | |
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
inherit_from: | |
- .rubocop_todo.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This configuration was generated by `rubocop --auto-gen-config` | |
# on 2015-07-24 12:18:10 +0900 using RuboCop version 0.32.1. | |
# The point is for the user to remove these configuration records | |
# one by one as the offenses are removed from the code base. | |
# Note that changes in the inspected code, or installation of new | |
# versions of RuboCop, may require this file to be generated again. | |
# Offense count: 1 | |
# Cop supports --auto-correct. | |
# Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods. | |
Style/BlockDelimiters: | |
Enabled: false | |
# Offense count: 1 | |
# Cop supports --auto-correct. | |
# Configuration parameters: MultiSpaceAllowedForOperators. | |
Style/SpaceAroundOperators: | |
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle exec rubocop --auto-gen-config | |
Inspecting 1 file | |
C | |
Offenses: | |
first.rb:1:21: C: Prefer {...} over do...end for single-line blocks. | |
[1, 2, 3, 4, 5].map do |i| puts i ** i end | |
^^ | |
first.rb:1:35: C: Space around operator ** detected. | |
[1, 2, 3, 4, 5].map do |i| puts i ** i end | |
^^ | |
1 file inspected, 2 offenses detected | |
Created .rubocop_todo.yml. | |
Run `rubocop --config .rubocop_todo.yml`, or | |
add inherit_from: .rubocop_todo.yml in a .rubocop.yml file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat first.rb | |
[1, 2, 3, 4, 5].map do |i| puts i ** i end | |
$ cat > .rubocop.yml | |
Style/SpaceAroundOperators: | |
Enabled: false | |
Style/BlockDelimiters: | |
Enabled: false | |
^C | |
$ bundle exec rubocop first.rb | |
Inspecting 1 file | |
. | |
1 file inspected, no offenses detected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
first.rb:1:21: C: Prefer {...} over do...end for single-line blocks. | |
[1, 2, 3, 4, 5].map do |i| puts i ** i end | |
^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
first.rb:1:35: C: Space around operator ** detected. | |
[1, 2, 3, 4, 5].map do |i| puts i ** i end | |
^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1, 2, 3, 4, 5].map do |i| puts i ** i end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby first.rb | |
1 | |
4 | |
27 | |
256 | |
3125 | |
$ bundle exec rubocop first.rb | |
Inspecting 1 file | |
C | |
Offenses: | |
first.rb:1:21: C: Prefer {...} over do...end for single-line blocks. | |
[1, 2, 3, 4, 5].map do |i| puts i ** i end | |
^^ | |
first.rb:1:35: C: Space around operator ** detected. | |
[1, 2, 3, 4, 5].map do |i| puts i ** i end | |
^^ | |
1 file inspected, 2 offenses detected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1, 2, 3, 4, 5].map { |i| puts i**i } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bundle exec rubocop first_fixed.rb | |
Inspecting 1 file | |
. | |
1 file inspected, no offenses detected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rubocop' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment