This repository has been archived by the owner on Apr 7, 2020. It is now read-only.
/
enabled.yml
137 lines (115 loc) · 2.89 KB
/
enabled.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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
require:
- rubocop-performance
AllCops:
# .ruby-version の指定と合わせるため指定しない
# TargetRubyVersion: ~
DisplayCopNames: true
DisplayStyleGuide: true
ExtraDetails: true
Exclude:
- 'tmp/**/*'
- 'db/schema.rb'
- 'node_modules/**/*'
- 'bin/rails'
- 'bin/rake'
- 'bin/rspec'
- 'bin/rubocop'
- 'bin/spring'
- 'bin/webpack'
- 'bin/webpack-dev-server'
Rails:
Enabled: true
Metrics/ClassLength:
CountComments: false
Max: 150
Metrics/ModuleLength:
CountComments: false
Max: 130
Metrics/LineLength:
Max: 250
AllowHeredoc: true
AllowURI: true
URISchemes:
- http
- https
Metrics/MethodLength:
Max: 40
Exclude:
# データ移行のためにSQLを書くことがあるため許容する
- 'db/migrate/*.rb'
Metrics/AbcSize:
Max: 50
Metrics/CyclomaticComplexity:
Max: 10
Metrics/PerceivedComplexity:
Max: 9
Naming/AccessorMethodName:
Exclude:
# # action_args を使うため
# before_action :set_user
#
# def set_user(id)
# @user = User.find(id)
# end
- '**/*_controller.rb'
- 'app/controllers/concerns/**/*.rb'
# # 宗教の違いを許容する
# def some_method_with_parameters param1, param2
# # body omitted
# end
#
# def some_method_with_parameters(param1, param2)
# # body omitted
# end
Style/MethodDefParentheses:
Enabled: false
# 日本語コメントを許容する
Style/AsciiComments:
Enabled: false
Style/LambdaCall:
Exclude:
# # jbuilder の README の通りに書いても検出されるため
# json.(@message, :created_at, :updated_at)
- '**/*.jbuilder'
# # consistent
# hash = {
# key: :value
# }
# and_in_a_method_call({
# no: :difference
# })
Layout/IndentFirstHashElement:
EnforcedStyle: consistent
# ドキュメントの無い public クラスを許容する
Style/Documentation:
Enabled: false
# email など NOT NULL でもデフォルト値を指定できないカラムは存在する
Rails/NotNullColumn:
Enabled: false
# map...flatten はだいたい flat_map に直せるのでチェックしておく
Performance/FlatMap:
EnabledForFlattenWithoutParams: true
# alias, alias_method で細かい挙動が変わるため、使い分ける必要がある
#
# 参考: http://blog.bigbinary.com/2012/01/08/alias-vs-alias-method.html
Style/Alias:
Enabled: false
# - Emacs のデフォルトが with_first_parameter
# - Vim のデフォルトが with_fixed_indentation
#
# という宗教の違いを許容する
Layout/AlignParameters:
Enabled: false
# データ移行のために execute を使うことがあるため許容する
Rails/ReversibleMigration:
Enabled: false
# typo に気付けるようにするため
Rails/UnknownEnv:
Environments:
- development
- test
- production
- staging
# 子レコードを残しておきたい場合もあるため許容する
Rails/HasManyOrHasOneDependent:
Enabled: false