config/.base_rubocop.yml in fablicop-1.0.6 vs config/.base_rubocop.yml in fablicop-1.0.7
- old
+ new
@@ -1,5 +1,8 @@
+require:
+ - rubocop-rails
+
# 自動生成されるものやテストデータはチェック対象から除外する
AllCops:
Exclude:
- "vendor/**/*" # rubocop config/default.yml
- "db/schema.rb"
@@ -8,11 +11,12 @@
- "test/factories/**/*"
- "spec/factories/**/*"
- "spec/test_app/db/*"
DisplayCopNames: true
- TargetRubyVersion: 2.3
+ TargetRubyVersion: 2.5
+ NewCops: enable # 新しい規約も随時取り入れる
Rails:
Enabled: true
# rails >= 5 の設定のため
Rails/HttpPositionalArguments:
Enabled: false
@@ -112,13 +116,10 @@
Enabled: false
Style/ParallelAssignment:
Enabled: false
-Style/BracesAroundHashParameters:
- Enabled: false
-
Style/MethodCallWithoutArgsParentheses:
Enabled: false
Style/DefWithParentheses:
Enabled: false
@@ -145,16 +146,12 @@
# 引数前のスペースは複数許可
Layout/SpaceBeforeFirstArg:
Enabled: false
Layout/SpaceInLambdaLiteral:
Enabled: false
-Layout/IndentHeredoc:
+Layout/HeredocIndentation:
Enabled: false
-Layout/MultilineMethodCallBraceLayout:
- Enabled: false
-Layout/MultilineMethodCallIndentation:
- Enabled: false
##################### Lint ##################################
# 引数前のスペースを許容する
Lint/ParenthesesAsGroupedExpression:
@@ -163,11 +160,11 @@
##################### Metrics ##################################
# * 警告 120文字
# * 禁止 160文字
# のイメージ
-Metrics/LineLength:
+Layout/LineLength:
Max: 160
Exclude:
- "db/migrate/*.rb"
# 20 行超えるのは migration ファイル以外滅多に無い
@@ -175,29 +172,23 @@
Max: 20
Exclude:
- "db/migrate/*.rb"
# キーワード引数は引数の数に含めない
-ParameterLists:
+Metrics/ParameterLists:
CountKeywordArgs: false
Metrics/BlockLength:
Max: 100
Exclude:
- "spec/**/*.rb"
- "test/**/*.rb"
- "app/admin/*.rb"
- "config/**/*.rb"
-# Explicitly set the default value 15
Metrics/AbcSize:
- Max: 15
Exclude:
- "test/**/*.rb"
-
-# キーワード引数は引数の数に含めない
-ParameterLists:
- CountKeywordArgs: false
Metrics/ClassLength:
Exclude:
- "test/**/*.rb"