forked from buildgroundwork/groundwork-style
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrubocop_rails.yml
194 lines (141 loc) · 3.3 KB
/
rubocop_rails.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
require: rubocop-rails
AllCops:
Include:
- '**/*.rb'
- '**/*.jbuilder'
- '**/*.rake'
- '**/config.ru'
- '**/Gemfile'
- '**/Rakefile'
- '**/*.gemspec'
Exclude:
- 'bin/**/*'
- 'node_modules/**/*'
- 'vendor/**/*'
TargetRailsVersion: 6.0
Rails/ActionControllerTestCase:
Enabled: true
Rails/ActiveRecordCallbacksOrder:
Enabled: true
Rails/AddColumnIndex:
Enabled: true
Rails/AfterCommitOverride:
Enabled: true
Rails/AttributeDefaultBlockValue:
Enabled: true
Rails/CompactBlank:
Enabled: true
Rails/DeprecatedActiveModelErrorsMethods:
Enabled: true
Rails/DotSeparatedKeys:
Enabled: true
Rails/DuplicateAssociation:
Enabled: true
Rails/DuplicateScope:
Enabled: true
Rails/DurationArithmetic:
Enabled: true
Rails/DynamicFindBy:
Whitelist:
# This is a Rails finder method
- find_by_sql
# We add this for proper finding in controllers
- find_by_param!
Rails/EagerEvaluationLogMessage:
Enabled: true
# This expects we'll copy all environment variables into the Rails config,
# which seems like a waste of time.
Rails/EnvironmentVariableAccess:
Enabled: false
Rails/ExpandedDateRange:
Enabled: true
Rails/FilePath:
EnforcedStyle: arguments
# ActiveRecord::Base#find is a disaster.
Rails/FindById:
Enabled: false
Rails/I18nLazyLookup:
Enabled: true
Rails/I18nLocaleAssignment:
Enabled: true
Rails/I18nLocaleTexts:
Enabled: true
Rails/Inquiry:
Enabled: true
# Why add an inverse_of if we don't need it?
Rails/InverseOf:
Enabled: false
Rails/MailerName:
Enabled: true
Rails/MatchRoute:
Enabled: true
# As of rubocop-rails 2.14.0, this cop does not properly handle migrations with
# class names that end in a number.s
Rails/MigrationClassName:
Enabled: false
Rails/NegateInclude:
Enabled: true
# NULL columns do not necessarily have a valid default value. Sometimes
# we want a NULL value to be an error; a default value would cover that
# error.
Rails/NotNullColumn:
Enabled: false
# #read_attribute and #write_attribute are easier to see, and
# arguable more clear, than the self[attr] syntax.
Rails/ReadWriteAttribute:
Enabled: false
# We want to skip validations in specs to keep them nice and fast.
# We should know when to skip validations outside of specs
Rails/SkipsModelValidations:
Enabled: false
# Add Rails-specific file exclusions
Style/MethodCallWithArgsParentheses:
Exclude:
- Gemfile
- config.ru
- config/*
- spec/**/*
- db/**/*
IgnoredMethods:
- task
- desc
Rails/Pluck:
Enabled: true
Rails/PluckInWhere:
Enabled: true
Rails/RedundantPresenceValidationOnBelongsTo:
Enabled: true
Rails/RedundantTravelBack:
Enabled: true
Rails/RenderInline:
Enabled: true
Rails/RenderPlainText:
Enabled: true
Rails/RequireDependency:
Enabled: true
Rails/RootJoinChain:
Enabled: true
Rails/RootPublicPath:
Enabled: true
# No need to enforce brevity over clarity.
Rails/ShortI18n:
Enabled: false
# We prefer multi-line SQL.
Rails/SquishedSQLHeredocs:
Enabled: false
Rails/StripHeredoc:
Enabled: true
Rails/TimeZoneAssignment:
Enabled: true
Rails/ToFormattedS:
Enabled: true
Rails/TransactionExitStatement:
Enabled: true
Rails/UnusedIgnoredColumns:
Enabled: true
Rails/WhereEquals:
Enabled: true
Rails/WhereExists:
Enabled: true
Rails/WhereNot:
Enabled: true