/
.rubocop.yml
154 lines (131 loc) · 4.03 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
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
inherit_from: .rubocop_todo.yml
require:
- rubocop-performance
- rubocop-rails
AllCops:
# be sure to set minimal support version
TargetRubyVersion: 3.0
NewCops: enable
Exclude:
- Guardfile
- Vagrantfile
- ",memo/**/*"
- bin/*
- vendor/bundle/**/*
- vendor/gems/**/*
# Default formatter will be used if no `-f/--format` option is given.
DefaultFormatter: fuubar
# Indent private/protected/public as deep as method definitions
Layout/AccessModifierIndentation:
EnforcedStyle: indent
SupportedStyles:
- outdent
- indent
# By default, the indentation width from Layout/IndentationWidth is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Layout/EmptyLineAfterGuardClause:
Enabled: false
Layout/DefEndAlignment:
AutoCorrect: false
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Layout/IndentationConsistency:
# The difference between `rails` and `normal` is that the `rails` style
# prescribes that in classes and modules the `protected` and `private`
# modifier keywords shall be indented the same as public methods and that
# protected and private members shall be indented one step more than the
# modifiers. Other than that, both styles mean that entities on the same
# logical depth shall have the same indentation.
EnforcedStyle: normal
SupportedStyles:
- normal
- rails
# Cop supports --auto-correct.
Layout/SpaceAfterComma:
Enabled: true
# Cop supports --auto-correct.
Layout/SpaceBeforeFirstArg:
# When `true`, allows most uses of extra spacing if the intent is to align
# things with the previous or next line, not counting empty lines or comment
# lines.
AllowForAlignment: true
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
Layout/SpaceInsideBlockBraces:
EnforcedStyle: space
EnforcedStyleForEmptyBraces: no_space
SpaceBeforeBlockParameters: true
# Cop supports --auto-correct.
Layout/TrailingWhitespace:
Enabled: true
Lint/RescueException:
Enabled: false
Metrics/ClassLength:
Enabled: true
Max: 500
Metrics/ModuleLength:
Enabled: true
Max: 500
Naming/MethodParameterName:
MinNameLength: 2
AllowedNames: [ 'f', 'e', 'n' ]
Rails:
Enabled: true
# Cop supports --auto-correct.
Rails/Output:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Checks if usage of `%()` or `%Q()` matches configuration.
Style/BarePercentLiterals:
EnforcedStyle: bare_percent
SupportedStyles:
- percent_q
- bare_percent
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/EmptyElse:
EnforcedStyle: empty
SupportedStyles:
- empty
- nil
- both
Style/IfInsideElse:
Enabled: false
# Cop supports --auto-correct.
# Configuration parameters: PreferredDelimiters.
Style/PercentLiteralDelimiters:
# Specify the default preferred delimiter for all types with the 'default' key
# Override individual delimiters (even with default specified) by specifying
# an individual key
PreferredDelimiters:
default: ()
'%i': '[]'
'%I': '[]'
'%r': '{}'
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
Style/SignalException:
EnforcedStyle: only_raise
SupportedStyles:
- only_raise
- only_fail
- semantic
# Cop supports --auto-correct.
Style/RedundantPercentQ:
Enabled: true
# Cop supports --auto-correct.
# Configuration parameters: WordRegex.
Style/WordArray:
EnforcedStyle: percent
SupportedStyles:
# percent style: %w(word1 word2)
- percent
# bracket style: ['word1', 'word2']
- brackets
# The `MinSize` option causes the `WordArray` rule to be ignored for arrays
# smaller than a certain size. The rule is only applied to arrays
# whose element count is greater than or equal to `MinSize`.
MinSize: 0
# The regular expression `WordRegex` decides what is considered a word.
WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'