-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop_base.yml
95 lines (86 loc) · 2.16 KB
/
.rubocop_base.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
require:
- rubocop-performance
- rubocop-rails
- rubocop-rake
AllCops:
NewCops: enable
SuggestExtensions: true
Rails:
Enabled: true
inherit_mode:
merge:
- Exclude
# クラスあたりの長さを制限
Metrics/ClassLength:
Max: 120
CountAsOne:
- array
- hash
- heredoc
- method_call
# メソッドあたりの長さを制限
Metrics/MethodLength:
Max: 20
CountAsOne:
- array
- hash
- heredoc
- method_call
# モジュールあたりの長さを制限
Metrics/ModuleLength:
Max: 200
CountAsOne:
- array
- hash
- heredoc
- method_call
# ブロックの長さを制限
Metrics/BlockLength:
Max: 50
CountAsOne:
- array
- hash
- heredoc
- method_call
Exclude:
# テストコードは長くなりやすいので除外
- 'spec/**/*'
- 'test/**/*'
# パラメータ数を制限
Metrics/ParameterLists:
Max: 5
MaxOptionalParameters: 3
# 複雑度による縛りは見送る まずは他のMetricsで対応する
Metrics/AbcSize:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
# 順番強制は既存の修正が多くなりすぎるため一旦見送る
Rails/ActionOrder:
Enabled: false
Rails/ActiveRecordCallbacksOrder:
Enabled: false
# ステータスコードば数字のままのほうが見やすい場合もあり書き換えるほどではないので無効化
Rails/HttpStatus:
Enabled: false
# 変数名でわかりやすくなっていれば問題ないとして無効化
Naming/HeredocDelimiterNaming:
Enabled: false
# render_404等、既存で多用しているメソッドも検出されるので無効化
Naming/VariableNumber:
Enabled: false
# classを分ける書き方は冗長になる可能性もあるので無効化
Rails/HasManyOrHasOneDependent:
Enabled: false
# ライブラリによる追加もあるので無効化
Rails/LexicallyScopedActionFilter:
Enabled: false
# 以降はRubyの専用記法を強制するルールだが、あえて書き直すほどではないため無効化
Style/NumericPredicate:
Enabled: false
Style/SymbolArray:
Enabled: false
Style/WordArray:
Enabled: false