-
Notifications
You must be signed in to change notification settings - Fork 15
/
.rubocop.yml
172 lines (134 loc) · 3.89 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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
inherit_from: .rubocop_todo.yml
inherit_mode:
merge:
- Exclude
require:
- rubocop-performance
- rubocop-rake
- rubocop-rspec
- rubocop-i18n
AllCops:
Exclude:
- 'lib/alexandria/default_preferences.rb'
- 'pkg/**/*'
NewCops: enable
TargetRubyVersion: 3.0
# Put development dependencies in the gemspec so rubygems.org knows about them
Gemspec/DevelopmentDependencies:
EnforcedStyle: gemspec
# Choose GetText-style I18n cops
I18n/GetText:
Enabled: true
# Exclude non-user-facing code
Exclude:
- Rakefile
- 'bin/*'
- 'spec/**/*'
- 'util/**/*'
I18n/RailsI18n:
Enabled: false
# This code has a lot of pre-existing translations with percent-style
# formatting. Maybe one day someone will re-do all of them ...
I18n/GetText/DecorateStringFormattingUsingPercent:
Enabled: false
# Disable cop in disabled department explictly until
# https://github.com/rubocop-hq/rubocop/pull/9258 is merged.
I18n/RailsI18n/DecorateString:
Enabled: false
# Make BeginEndAlignment behavior match EndAlignment
Layout/BeginEndAlignment:
EnforcedStyleAlignWith: begin
Layout/HashAlignment:
EnforcedColonStyle: key
EnforcedHashRocketStyle: table
# Be lenient with line length
Layout/LineLength:
Max: 92
# Don't force lonely closing parentheses
Layout/MultilineMethodCallBraceLayout:
EnforcedStyle: same_line
# Multi-line method calls should be simply indented. Aligning them makes it
# even harder to keep a sane line length.
Layout/MultilineMethodCallIndentation:
EnforcedStyle: indented
# Multi-line assignment should be simply indented. Aligning them makes it even
# harder to keep a sane line length.
Layout/MultilineOperationIndentation:
EnforcedStyle: indented
# Force consistent spacing independent of block contents
Layout/SpaceBeforeBlockBraces:
EnforcedStyleForEmptyBraces: space
# Assume the programmer knows how bracketed block syntax works
Lint/AmbiguousBlockAssociation:
Enabled: false
# Assume the programmer knows precendence rules
Lint/AmbiguousOperatorPrecedence:
Enabled: false
# Allow if (foo = get_foo) style
Lint/AssignmentInCondition:
AllowSafeAssignment: true
# This cop's reach is too broad
# See https://github.com/rubocop-hq/rubocop/pull/8480
Lint/MissingSuper:
Enabled: false
# Blocks in specs can be any size
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
Naming/AccessorMethodName:
Enabled: false
# Avoid one-letter exception variable name
Naming/RescuedExceptionsVariableName:
PreferredName: ex
Performance/EndWith:
AutoCorrect: true
Performance/StartWith:
AutoCorrect: true
# End-to-end specs do not describe classes
RSpec/DescribeClass:
Exclude:
- 'spec/end_to_end/**/*_spec.rb'
RSpec/ExampleLength:
Max: 8
Exclude:
- 'spec/end_to_end/**/*_spec.rb'
# Allow and/or for control flow only
Style/AndOr:
EnforcedStyle: conditionals
# Require at least two dependent lines before suggesting a guard clause
Style/GuardClause:
MinBodyLength: 2
# Sometimes an if statement just looks better than next with a guard clause
Style/Next:
Enabled: false
# Not all objects that handle #== 0 also handle #zero?
Style/NumericPredicate:
Enabled: false
# Use older RuboCop default
Style/PercentLiteralDelimiters:
PreferredDelimiters:
'%W': ()
'%w': ()
# Allow explicit return with multiple return values
Style/RedundantReturn:
AllowMultipleReturnValues: true
Style/SingleLineBlockParams:
Enabled: false
# Allow all ways to construct strings for now
Style/StringConcatenation:
Enabled: false
# Do not commit to use of interpolation
Style/StringLiterals:
EnforcedStyle: double_quotes
# Prefer symbols to look like symbols
Style/SymbolArray:
EnforcedStyle: brackets
# Accessors are only trivial if they match the ivar name
Style/TrivialAccessors:
ExactNameMatch: true
# Allow semantic choice of trailing comma
Style/TrailingCommaInArrayLiteral:
Enabled: false
# Alexandria uses regular arrays
Style/WordArray:
Enabled: false