Skip to content

Instantly share code, notes, and snippets.

@kyohei-shimada
Last active February 3, 2017 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyohei-shimada/1eae80f83133beb0590ec8d4d5e5ab43 to your computer and use it in GitHub Desktop.
Save kyohei-shimada/1eae80f83133beb0590ec8d4d5e5ab43 to your computer and use it in GitHub Desktop.
rubocopが一切使われていないRailsアプリにrubocopを段階的に導入していく際にやったこと/やりたいこと ref: http://qiita.com/kyohei_shimada/items/e739dec967eb5e61721c
bundle exec rubocop -D -R
# ...
629 files inspected, 8475 offenses detected
git diff --shortstat
381 files changed, 4285 insertions(+), 4388 deletions(-)
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -1092,22 +1092,6 @@ Style/SpaceAfterComma:
Style/SpaceAroundEqualsInParameterDefault:
Enabled: false
-# Offense count: 50
-# Cop supports --auto-correct.
-# Configuration parameters: MultiSpaceAllowedForOperators.
-Style/SpaceAroundOperators:
- Exclude:
- # 無視しているファイル名一覧
+Style/SpaceAroundOperators:
+ Severity: warning
+ AllowForAlignment: true
bundle exec rubocop -D -R -c .rubocop_todo.yml --only Style/SpaceAroundOperators
bundle exec rubocop -D -R -c .rubocop_todo.yml --only Style/SpaceAroundOperators --auto-correct
gem 'rubocop'
bundle install
bundle exec rubocop -R -D
bundle exec rubocop -R --auto-gen-config --exclude-limit 999999
bundle exec rubocop -D -R -c .rubocop_todo.yml
# fail-levelは 3.で直したレベルを設定しておく
bundle exec rubocop -R -D --fail-level W
touch .rubocop.yml
inherit_from: .rubocop.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment