-
Notifications
You must be signed in to change notification settings - Fork 3
/
base.yml
210 lines (172 loc) · 6.69 KB
/
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
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# RuboCop の基本設定ファイル
require: rubocop-performance
########################################
# Bundler Cops: Gemfile 用の設定
# - RuboCop のデフォルト設定に従う
########################################
########################################
# Layout Cops
########################################
# end の位置は、Block の開始レベルに合わせるi
# - Block の Scope がわかりやすくなる
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutblockalignment
#
Layout/BlockAlignment:
EnforcedStyleAlignWith: start_of_block
# クラス内の要素定義順を、Style Guide の推奨順に強制する
# - 迷いがちなので、強制されたほうが楽
#
# Style Guide: https://rubystyle.guide/#classes-modules
# Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutclassstructure
#
Layout/ClassStructure:
Enabled: true
# メソッド定義終了の end の位置は、def の開始レベルに合わせる
# - メソッドの Scope がわかりやすくなる
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutdefendalignment
#
Layout/DefEndAlignment:
AutoCorrect: true
EnforcedStyleAlignWith: def
# AttributeAccessor の定義の前後には空行を入れる
# - NOTE: from 0.83
#
# Style Guide: https://rubystyle.guide/#empty-lines-around-attribute-accessor
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutemptylinesaroundattributeaccessor
#
Layout/EmptyLinesAroundAttributeAccessor:
Enabled: true
# end の位置は、if,class などキーワードの開始レベルに合わせる
# - Scope がわかりやすくなる
# - NOTE: AutoCorrect を有効化
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutendalignment
#
Layout/EndAlignment:
AutoCorrect: true
# 複数行の配列の第1要素の改行時のインデントは、1レベルのみ下げる:
# - 1行あたりの長さを抑えたい
# - Hashのルールに合わせる
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutfirstarrayelementindentation
#
Layout/FirstArrayElementIndentation:
EnforcedStyle: consistent
# 複数行の配列の第1要素は必ず改行後に書く:
# - Hash、メソッド引数のルールに合わせる
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutfirstarrayelementlinebreak
#
Layout/FirstArrayElementLineBreak:
Enabled: true
# 複数行のHashの第1要素の改行時のインデントは、1レベルのみ下げる:
# - 1行あたりの長さを抑えたい
# - 配列のルールに合わせる
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutfirsthashelementindentation
#
Layout/FirstHashElementIndentation:
EnforcedStyle: consistent
# 複数行のHashの第1要素は必ず改行後に書く:
# - 配列、メソッド引数のルールに合わせる
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutfirsthashelementlinebreak
#
Layout/FirstHashElementLineBreak:
Enabled: true
# メソッド引数が複数行に渡る場合、第1引数は必ず改行後に書く:
# - 配列、Hashのルールに合わせる
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutfirstmethodargumentlinebreak
#
Layout/FirstMethodArgumentLineBreak:
Enabled: true
# メソッド引数の定義が複数行に渡る場合、第1引数は必ず改行後に書く:
# - 配列、Hashのルールに合わせる
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutfirstmethodparameterlinebreak
#
Layout/FirstMethodParameterLineBreak:
Enabled: true
# HashのKey, Valueの揃え方:
# - Key, Value ともに頭を揃える
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layouthashalignment
#
Layout/HashAlignment:
EnforcedColonStyle: table
EnforcedHashRocketStyle: table
# メソッド引数に Heredoc が含まれる場合、メソッド引数の閉じ括弧はHeredocの開始よりも前に書く
#
# Style Guide: https://rubystyle.guide/#heredoc-argument-closing-parentheses
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutheredocargumentclosingparenthesis
#
Layout/HeredocArgumentClosingParenthesis:
Enabled: true
# TODO: 1 行あたりの最大文字数を100文字とする。
# - Style Guideでは80文字だが、80文字だと少し短いことが多い
#
# Style Guide: https://rubystyle.guide/#80-character-limits
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutlinelength
#
Layout/LineLength:
Max: 100
# メソッド呼び出しを複数行に渡りChainする場合、メソッドの呼び出しはレシーバーよりインデントを1レベル下げる
# - インデントしない場合、行継続かどうかがパッと見でわかりづらい
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutmultilinemethodcallindentation
#
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented_relative_to_receiver
# if, return 等の引数を複数行に渡って書く場合、2行目以降のインデントを1レベル下げる
# - 同上
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutmultilineoperationindentation
#
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# メソッド呼び出し時に、.とメソッド名の間にスペースを入れない
# - NOTE: from 0.82
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layoutspacearoundmethodcalloperator
#
Layout/SpaceAroundMethodCallOperator:
Enabled: true
# 行末のスペースを許可しない
# - NOTE: Heredoc の中でも許可しない(Markdownなどを書くときは magic comment で個別に disable する)
#
# RuboCop Docs: https://docs.rubocop.org/en/stable/cops_layout/#layouttrailingwhitespace
#
Layout/TrailingWhitespace:
AllowInHeredoc: false
########################################
# Linting Cops: TODO
########################################
#
#
# RuboCop Docs:
#
########################################
# Metrics Cops: TODO
########################################
########################################
# Migration Cops: TODO
########################################
########################################
# Naming Cops: TODO
########################################
########################################
# Performance Cops: TODO
########################################
########################################
# Security Cops: TODO
########################################
########################################
# Style Cops: TODO
########################################
Style/AsciiComments:
Enabled: false
Style/Documentation:
Enabled: false