forked from eityamo/hotsnack-gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.rubocop.yml
96 lines (77 loc) · 2.2 KB
/
.rubocop.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
# 将来的には対応する規約の読込(ファイル内が空になったら、この行は削除)
inherit_from: .rubocop_todo.yml
# 追加した規約ファイル読込
require:
- rubocop-rails
# 全体に適応する項目を定義。ここで Exclude に設定したファイルは、チェック対象外になる。
AllCops:
# 除外
Exclude:
- 'vendor/**/*'
- 'bin/**'
- 'db/**/*'
- 'lib/**/*'
- 'spec/**/*'
- 'node_modules/**/*'
- 'Gemfile'
DisplayCopNames: true
# RuboCopのバージョンがあがった際に追加されたCopを自動で有効
NewCops: enable
SuggestExtensions: false
Rails:
Enabled: true
# ブロックの改行チェック
Layout/MultilineBlockLayout:
Exclude:
- 'spec/**/*_spec.rb'
# ソースコードの行の長さチェック
Layout/LineLength:
Enabled: false
# ブロックの長さチェック
Metrics/BlockLength:
Max: 30
Exclude:
- 'Gemfile'
- 'config/routes.rb'
- 'spec/**/*'
# クラスの長さチェック
Metrics/ClassLength:
CountComments: false
Max: 300
# メソッドの複雑さチェック
Metrics/CyclomaticComplexity:
Max: 30
# メソッドの長さチェック
Metrics/MethodLength:
CountComments: false
Max: 30
# 中括弧や do/end が一行または複数行のブロックに使用されているかチェック
Style/BlockDelimiters:
Exclude:
- 'spec/**/*'
# 日本語でのコメントを許可
AsciiComments:
Enabled: false
# trueかfalseを設定しないと警告が出る
# https://rubocop.readthedocs.io/en/stable/cops_style/#stylehasheachmethods
Style/HashEachMethods:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Enabled: true
# モジュール名::クラス名の定義を許可
ClassAndModuleChildren:
Enabled: false
# ドキュメントの無いpublic classを許可する
Style/Documentation:
Enabled: false
# 文字リテラルのイミュータブル宣言を無視(freezeになるのはRuby3以降)
Style/FrozenStringLiteralComment:
Enabled: false
# アルファベット順にソートチェック
Bundler/OrderedGems:
Enabled: false
# ダブルクオートを使う
StringLiterals:
EnforcedStyle: double_quotes